org.xwiki.rendering.internal.macro
Class DefaultMacroCategoryManager

java.lang.Object
  extended by org.xwiki.rendering.internal.macro.DefaultMacroCategoryManager
All Implemented Interfaces:
MacroCategoryManager

@Component
@Singleton
public class DefaultMacroCategoryManager
extends java.lang.Object
implements MacroCategoryManager

Default implementation of MacroCategoryManager.

Since:
2.0M3
Version:
$Id$

Constructor Summary
DefaultMacroCategoryManager()
           
 
Method Summary
 java.util.Set<java.lang.String> getMacroCategories()
          Returns all the macro categories currently available in the system.
 java.util.Set<java.lang.String> getMacroCategories(Syntax syntax)
          Returns all the macro categories currently available in the system for macros registered for a given syntax and for all syntaxes.
 java.util.Set<MacroId> getMacroIds(java.lang.String category)
          
 java.util.Set<MacroId> getMacroIds(java.lang.String category, Syntax syntax)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultMacroCategoryManager

public DefaultMacroCategoryManager()
Method Detail

getMacroCategories

public java.util.Set<java.lang.String> getMacroCategories()
                                                   throws MacroLookupException
Returns all the macro categories currently available in the system. Macros that don't have default or overridden categories are not included and thus clients should be aware that there can be macros in the system which do not belong to any category.

Specified by:
getMacroCategories in interface MacroCategoryManager
Returns:
the macro categories available in the system.
Throws:
MacroLookupException - error when looking up macros
See Also:
MacroCategoryManager.getMacroCategories()

getMacroCategories

public java.util.Set<java.lang.String> getMacroCategories(Syntax syntax)
                                                   throws MacroLookupException
Returns all the macro categories currently available in the system for macros registered for a given syntax and for all syntaxes. Macros that don't have default or overridden categories are not included and thus clients should be aware that there can be macros in the system which do not belong to any category.

Specified by:
getMacroCategories in interface MacroCategoryManager
Parameters:
syntax - the syntax to filter the macros by syntax.
Returns:
the macro categories available for the given syntax
Throws:
MacroLookupException - error when looking up macros
See Also:
MacroCategoryManager.getMacroCategories(org.xwiki.rendering.syntax.Syntax)

getMacroIds

public java.util.Set<MacroId> getMacroIds(java.lang.String category)
                                   throws MacroLookupException

Specified by:
getMacroIds in interface MacroCategoryManager
Parameters:
category - name of the category or null.
Returns:
ids of all the macros belonging to the given category or if the category parameter is null, ids of all the macros which do not belong to any category.
Throws:
MacroLookupException - error when lookup macros
See Also:
MacroCategoryManager.getMacroIds(String)

getMacroIds

public java.util.Set<MacroId> getMacroIds(java.lang.String category,
                                          Syntax syntax)
                                   throws MacroLookupException

Specified by:
getMacroIds in interface MacroCategoryManager
Parameters:
category - name of the category or null.
syntax - the syntax to filter the macros by syntax.
Returns:
ids of all the macros belonging to the given category (and registered for the given syntax) or if the category parameter is null, ids of all the macros which do not belong to any category (and registered for the given syntax).
Throws:
MacroLookupException - error when lookup macros
See Also:
MacroCategoryManager.getMacroIds(String, org.xwiki.rendering.syntax.Syntax)


Copyright © 2004-2011 XWiki. All Rights Reserved.