Class MacroTransformationContext
- java.lang.Object
-
- org.xwiki.rendering.transformation.MacroTransformationContext
-
- All Implemented Interfaces:
Cloneable
public class MacroTransformationContext extends Object implements Cloneable
The context of the macro transformation process. Contains information such as the current XWiki DOM for the parsed content and the current Macro block being processed by the Macro transformation.- Version:
- $Id: cc5af9ebda2ccc51c51c4305fa19b06f5275ed2e $
-
-
Constructor Summary
Constructors Constructor Description MacroTransformationContext()
Constructor.MacroTransformationContext(TransformationContext transformationContext)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MacroTransformationContext
clone()
MacroBlock
getCurrentMacroBlock()
String
getId()
Syntax
getSyntax()
Transformation
getTransformation()
TransformationContext
getTransformationContext()
XDOM
getXDOM()
boolean
isInline()
void
setCurrentMacroBlock(MacroBlock currentMacroBlock)
void
setId(String id)
void
setInline(boolean inline)
void
setSyntax(Syntax syntax)
void
setTransformation(Transformation transformation)
void
setXDOM(XDOM xdom)
-
-
-
Constructor Detail
-
MacroTransformationContext
public MacroTransformationContext()
Constructor.
-
MacroTransformationContext
public MacroTransformationContext(TransformationContext transformationContext)
Constructor.- Parameters:
transformationContext
- the context of the transformation process.- Since:
- 2.4M1
-
-
Method Detail
-
getTransformationContext
public TransformationContext getTransformationContext()
- Returns:
- the context of the transformation process.
- Since:
- 2.4M1
-
setCurrentMacroBlock
public void setCurrentMacroBlock(MacroBlock currentMacroBlock)
- Parameters:
currentMacroBlock
- the macro currently being processed.
-
getCurrentMacroBlock
public MacroBlock getCurrentMacroBlock()
- Returns:
- the macro currently being processed.
-
setXDOM
public void setXDOM(XDOM xdom)
- Parameters:
xdom
- the completeXDOM
of the page currently being transformed.
-
setInline
public void setInline(boolean inline)
- Parameters:
inline
- if true then the macro is called in inline mode
-
isInline
public boolean isInline()
- Returns:
- true if the macro is called in inline mode (ie inside a paragraph, a list item, etc)
-
setTransformation
public void setTransformation(Transformation transformation)
- Parameters:
transformation
- the Transformation being used- Since:
- 2.4M1
- See Also:
getTransformation()
-
getTransformation
public Transformation getTransformation()
- Returns:
- the current Transformation instance being executed. Useful for Macros which need to perform other transformations in turn such as the Include macro which needs to execute the transformation if the included page should be executed in its own context.
- Since:
- 2.4M1
-
setSyntax
public void setSyntax(Syntax syntax)
- Parameters:
syntax
- the current syntax.
-
getSyntax
public Syntax getSyntax()
- Returns:
- the current syntax.
-
getId
public String getId()
- Returns:
- an id representing the transformation being evaluated. It's a free form name that Transformations can use, for example if they need to perform some caching based on a key. For example the Velocity Macro is using this id to pass it to the underlying Velocity Engine so that it caches macros using this key.
-
clone
public MacroTransformationContext clone()
-
-