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: dcc1c1225235b33eb896167b42d68f30f8db2b44 $
  • Method Details

    • 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.
      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
    • prepare

      @Unstable default void prepare(Block block)
      Prepare a block meant to be cached to be executed several times. The goal is to pre-execute everything that can fit in any context and generally store them in block attributes (which are not serialized).
      Parameters:
      block - the block to prepare (can be an XDOM)
      Since:
      15.9RC1