Packages

case class RewriteRules(spanRules: Seq[RewriteRule[Span]] = Nil, blockRules: Seq[RewriteRule[Block]] = Nil, templateRules: Seq[RewriteRule[TemplateSpan]] = Nil) extends Product with Serializable

A set of rewrite rules describing a set of modifications to be applied to an AST of a document.

For reasons of type-safety the major element type blocks and spans (in markup documents) and template spans (in template documents) have their separate set of rules, as an element in a block position for example can usually only be replaced by another block and not by any other element type.

Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. RewriteRules
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new RewriteRules(spanRules: Seq[RewriteRule[Span]] = Nil, blockRules: Seq[RewriteRule[Block]] = Nil, templateRules: Seq[RewriteRule[TemplateSpan]] = Nil)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def ++(other: RewriteRules): RewriteRules

    Combines the rules defined in this instance with the rules defined in the specified other instance.

    Combines the rules defined in this instance with the rules defined in the specified other instance. If a rule in this instance matches the same instance as another rule in the other instance, the rule in this instance will be applied first, before its result gets passed to the other function.

  4. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. val blockRules: Seq[RewriteRule[Block]]
  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  14. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  15. def rewriteBlock(block: Block): Block

    Rewrites the specified block based on the set of rules in this instance.

    Rewrites the specified block based on the set of rules in this instance.

    If the rule is not defined for the block or the rule returns a Retain action as a result the old block will be returned unchanged.

    If it returns Replace with a new block that block will be returned. If it returns Remove then an empty block container will be returned.

    The rewriting is performed bottom-up (depth-first), including any children (blocks and spans) of the specified block, therefore an element passed to the rule only contains children which have already been processed.

  16. def rewriteBlocks(blocks: Seq[Block]): Seq[Block]

    Rewrites the specified sequence of blocks based on the set of rules in this instance.

    Rewrites the specified sequence of blocks based on the set of rules in this instance.

    If the rule is not defined for a specific block or the rule returns a Retain action as a result the old block remains in the tree unchanged.

    If it returns Remove then the block gets removed from the ast, if it returns Replace with a new block it will replace the old one.

    The size of the returned Seq is always between 0 and the number of blocks passed to this function.

    The rewriting is performed bottom-up (depth-first), therefore any element passed to the rule only contains children which have already been processed. If the blocks contain span elements, the span rules defined in this instance will also be applied recursively.

  17. def rewriteElement(element: Element): Element

    Rewrites the specified element based on the set of rules in this instance.

    Rewrites the specified element based on the set of rules in this instance.

    If the rule is not defined for the element or the rule returns a Retain action as a result the old element will be returned unchanged.

    If it returns Replace with a new element that element will be returned. If it returns Remove then an empty element container will be returned.

    If the specified element type does not support rewriting, it is returned unchanged.

    The rewriting is performed bottom-up (depth-first), including any children of the specified element, therefore an element passed to the rule only contains children which have already been processed.

  18. def rewriteSpan(span: Span): Span

    Rewrites the specified span based on the set of rules in this instance.

    Rewrites the specified span based on the set of rules in this instance.

    If the rule is not defined for the span or the rule returns a Retain action as a result the old span will be returned unchanged.

    If it returns Replace with a new span that span will be returned. If it returns Remove then an empty span container will be returned.

    The rewriting is performed bottom-up (depth-first), including any children of the specified span, therefore an element passed to the rule only contains children which have already been processed.

  19. def rewriteSpans(spans: Seq[Span]): Seq[Span]

    Rewrites the specified sequence of spans based on the set of rules in this instance.

    Rewrites the specified sequence of spans based on the set of rules in this instance.

    If the rule is not defined for a specific span or the rule returns a Retain action as a result the old span remains in the tree unchanged.

    If it returns Remove then the span gets removed from the ast, if it returns Replace with a new span it will replace the old one.

    The size of the returned Seq is always between 0 and the number of spans passed to this function.

    The rewriting is performed bottom-up (depth-first), therefore any element passed to the rule only contains children which have already been processed.

  20. def rewriteTemplateSpan(span: TemplateSpan): TemplateSpan

    Rewrites the specified template span based on the set of rules in this instance.

    Rewrites the specified template span based on the set of rules in this instance.

    If the rule is not defined for the span or the rule returns a Retain action as a result the old span will be returned unchanged.

    If it returns Replace with a new span that span will be returned. If it returns Remove then an empty template span container will be returned.

    The rewriting is performed bottom-up (depth-first), including any children of the specified template span, therefore an element passed to the rule only contains children which have already been processed.

  21. def rewriteTemplateSpans(spans: Seq[TemplateSpan]): Seq[TemplateSpan]

    Rewrites the specified sequence of template spans based on the set of rules in this instance.

    Rewrites the specified sequence of template spans based on the set of rules in this instance.

    If the rule is not defined for a specific span or the rule returns a Retain action as a result the old span remains in the tree unchanged.

    If it returns Remove then the span gets removed from the ast, if it returns Replace with a new span it will replace the old one.

    The size of the returned Seq is always between 0 and the number of template spans passed to this function.

    The rewriting is performed bottom-up (depth-first), therefore any element passed to the rule only contains children which have already been processed.

  22. val spanRules: Seq[RewriteRule[Span]]
  23. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  24. val templateRules: Seq[RewriteRule[TemplateSpan]]
  25. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped