org.xwiki.rendering.transformation
Interface Transformation

All Superinterfaces:
Comparable<Transformation>
All Known Implementing Classes:
AbstractTransformation

@Role
public interface Transformation
extends Comparable<Transformation>

Performs a transformation on a XDOM (i.e. a tree of Block. This used for example for transforming Macro Blocks into other Blocks corresponding to the execution of the Macros. Another example of transformation would be looking for all words that have an entry on Wikipedia and adding links to them.

Since:
1.5M2
Version:
$Id: 95e561cf9c31005b1e5e2d3f9314d71cf06ce436 $

Method Summary
 int getPriority()
          The priority of execution relative to the other transformations.
 void transform(Block block, TransformationContext context)
          Transform the passed XDOM and modifies it.
 void transform(XDOM dom, Syntax syntax)
          Deprecated. since 2.4M1 use transform(Block, TransformationContext) instead
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

getPriority

int getPriority()
The priority of execution relative to the other transformations. The lowest values have the highest priorities and execute first. For example a Transformation with a priority of 100 will execute before one with a priority of 500.

Returns:
the execution priority

transform

@Deprecated
void transform(XDOM dom,
                          Syntax syntax)
               throws TransformationException
Deprecated. since 2.4M1 use transform(Block, TransformationContext) instead

Transform the passed XDOM and modifies it.

Parameters:
dom - the AST representing the content in Blocks
syntax - the Syntax of the content
Throws:
TransformationException - if the transformation fails for any reason

transform

void transform(Block block,
               TransformationContext context)
               throws TransformationException
Transform the passed XDOM and modifies it.

Parameters:
block - the block to transform (can be an XDOM)
context - the context of the transformation process (syntax, transformation id, etc)
Throws:
TransformationException - if the transformation fails for any reason
Since:
2.4M1


Copyright © 2004–2013 XWiki. All rights reserved.