org.xwiki.rendering.macro
Class MacroId
java.lang.Object
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:
- a string representing a technical id (eg "toc")
- an optional syntax (can be null) if the macro is only available for a given syntax
- Since:
- 2.0M3
- Version:
- $Id: 603b517f34e5d9dcca7208dbd2eb331ec5565a2a $
|
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. |
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()
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–2015 XWiki. All rights reserved.