org.xwiki.rendering.transformation
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$
MacroTransformationContext
public MacroTransformationContext()
- Constructor.
MacroTransformationContext
public MacroTransformationContext(TransformationContext transformationContext)
- Constructor.
- Parameters:
transformationContext - the context of the transformation process.- Since:
- 2.4M1
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 complete XDOM of the page currently being transformed.
getXDOM
public XDOM getXDOM()
- Returns:
- the complete
XDOM of the page currently being transformed.
setInline
public void setInline(boolean isInline)
- Parameters:
isInline - 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.
setId
public void setId(String id)
- Parameters:
id - see getId()
clone
public MacroTransformationContext clone()
-
- Overrides:
clone in class Object
- See Also:
Object.clone()
Copyright © 2004-2011 XWiki. All Rights Reserved.