org.xwiki.rendering.macro
Class MacroId

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

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

Constructor Detail

MacroId

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

Parameters:
id - see getId()

MacroId

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

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

getId

public java.lang.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 java.lang.String toString()

Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()

equals

public boolean equals(java.lang.Object object)

Overrides:
equals in class java.lang.Object
See Also:
Object.equals(Object)


Copyright © 2004-2011 XWiki. All Rights Reserved.