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: fcd7e17d5e546b73484ab9e2a4a415bfe8f8fc8d $
    • 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

        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