Class TransformationContext
java.lang.Object
org.xwiki.rendering.transformation.TransformationContext
- All Implemented Interfaces:
Cloneable
The context of the transformation process. Contains information such as the current XWiki DOM for the parsed content.
- Since:
- 2.4M1
- Version:
- $Id: 344d9a5cee21cbd7677bc002149f90197cae0394 $
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor that doesn't set the XDOM or the Syntax.TransformationContext(XDOM xdom, Syntax syntax) Some macros require the XDOM and the Syntax to be set.TransformationContext(XDOM xdom, Syntax syntax, boolean restricted) Some macros require the XDOM and the Syntax to be set. -
Method Summary
Modifier and TypeMethodDescriptionclone()getId()getXDOM()booleanvoidvoidsetRestricted(boolean restricted) voidvoidsetTargetSyntax(Syntax targetSyntax) void
-
Constructor Details
-
TransformationContext
public TransformationContext()Default constructor that doesn't set the XDOM or the Syntax. This is because setting the XDOM and the Syntax is optional and only required by some Macros to behave as expected. -
TransformationContext
Some macros require the XDOM and the Syntax to be set.- Parameters:
xdom- seesetXDOM(org.xwiki.rendering.block.XDOM)syntax- seesetSyntax(org.xwiki.rendering.syntax.Syntax)
-
TransformationContext
Some macros require the XDOM and the Syntax to be set.- Parameters:
xdom- seesetXDOM(org.xwiki.rendering.block.XDOM)syntax- seesetSyntax(org.xwiki.rendering.syntax.Syntax)restricted- disables potentially harmful transformations.
-
-
Method Details
-
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.
- Since:
- 2.4M2
-
setId
- Parameters:
id- the id- Since:
- 2.4M2
- See Also:
-
setXDOM
- Parameters:
xdom- the completeXDOMof the content currently being transformed.
-
getXDOM
- Returns:
- the complete
XDOMof the content currently being transformed.
-
setSyntax
- Parameters:
syntax- the current syntax.
-
getSyntax
- Returns:
- the current syntax.
-
isRestricted
public boolean isRestricted()- Returns:
- indicator of whether the transformation context is restricted or not.
-
setRestricted
public void setRestricted(boolean restricted) - Parameters:
restricted- set indicator of whether the transformation context is restricted or not.
-
getTargetSyntax
- Returns:
- the syntax of the renderer
-
setTargetSyntax
- Parameters:
targetSyntax- the syntax of the renderer
-
clone
-