org.xwiki.rendering.internal.macro
Class DefaultMacroManager

java.lang.Object
  extended by org.xwiki.rendering.internal.macro.DefaultMacroManager
All Implemented Interfaces:
MacroManager

@Component
@Singleton
public class DefaultMacroManager
extends Object
implements MacroManager

Default MacroManager implementation, retrieves all Macro implementations that are registered against XWiki's component manager.

Since:
1.9M1
Version:
$Id$

Constructor Summary
DefaultMacroManager()
           
 
Method Summary
 boolean exists(MacroId macroId)
          
 Macro<?> getMacro(MacroId macroId)
          
 Set<MacroId> getMacroIds()
          
 Set<MacroId> getMacroIds(Syntax syntax)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultMacroManager

public DefaultMacroManager()
Method Detail

getMacroIds

public Set<MacroId> getMacroIds()
                         throws MacroLookupException

Specified by:
getMacroIds in interface MacroManager
Returns:
all the available macros whether they are registered for a given syntax or for all syntaxes
Throws:
MacroLookupException - error when lookup macros
See Also:
MacroManager.getMacroIds()

getMacroIds

public Set<MacroId> getMacroIds(Syntax syntax)
                         throws MacroLookupException

Specified by:
getMacroIds in interface MacroManager
Parameters:
syntax - the desired syntax
Returns:
the available macro ids for the desired syntax (this includes macros registered for all syntaxes and macros registered only for a given syntax)
Throws:
MacroLookupException - error when lookup macros
See Also:
MacroManager.getMacroIds(Syntax)

getMacro

public Macro<?> getMacro(MacroId macroId)
                  throws MacroLookupException

Specified by:
getMacro in interface MacroManager
Parameters:
macroId - the id of the macro to lookup
Returns:
the macro, looked-up first as a macro for the desired syntax identifier (if any is specified in the MacroId) and then as a macro registered for all syntaxes if not found
Throws:
MacroLookupException - when no macro with such id was found in both the list of macro for the specified syntax identifier and for all syntaxes
See Also:
MacroManager.getMacro(org.xwiki.rendering.macro.MacroId)

exists

public boolean exists(MacroId macroId)

Specified by:
exists in interface MacroManager
Parameters:
macroId - the id of the macro to lookup
Returns:
true if a macro with the given id and for the given syntax can be found (if any is specified in the MacroId), false otherwise. Returns false if a macro with the given id exists but has been registered only for all syntaxes
See Also:
MacroManager.exists(org.xwiki.rendering.macro.MacroId)


Copyright © 2004-2011 XWiki. All Rights Reserved.