org.xwiki.rendering.macro
Class MacroId

java.lang.Object
  extended by org.xwiki.rendering.macro.MacroId

public class MacroId
extends Object

Represents a Macro identifier. This is used when we need to pass a reference of a macro around without having to pass Macro instances; it's also required when we need to create a Macro instance from an identifier.

A Macro is identified by 2 parameters:

Since:
2.0M3
Version:
$Id$

Constructor Summary
MacroId(String id)
          Constructor for macros registered for all syntaxes.
MacroId(String id, Syntax syntax)
          Constructor for macros registered for a specific syntax only.
 
Method Summary
 boolean equals(Object object)
           
 String getId()
           
 Syntax getSyntax()
           
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MacroId

public MacroId(String id)
Constructor for macros registered for all syntaxes.

Parameters:
id - see getId()

MacroId

public MacroId(String id,
               Syntax syntax)
Constructor for macros registered for a specific syntax only.

Parameters:
id - see getId()
syntax - see getSyntax()
Method Detail

getId

public String getId()
Returns:
the technical id of the macro (eg "toc" for the TOC Macro)

getSyntax

public Syntax getSyntax()
Returns:
the optional syntax (can be null) for which the macro represented by this id is available. If null then the macro is available for all syntaxes.

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object object)
Overrides:
equals in class Object


Copyright © 2004-2012 XWiki. All Rights Reserved.