Interface MacroContentParser


  • @Role
    public interface MacroContentParser
    Parses content of a macro field (parameter, macro content) in a given syntax.
    Since:
    3.3M1
    Version:
    $Id: c0299272c20a2db1fa973492e2d0f3bff51725b8 $
    • Method Detail

      • parse

        XDOM parse​(String content,
                   MacroTransformationContext macroContext,
                   boolean transform,
                   boolean inline)
            throws MacroExecutionException
        Parses content of a macro field (parameter, macro content) in a given syntax and optionally remove the top level paragraph.
        Parameters:
        content - the content to parse
        macroContext - the executing Macro context (from which to get the current syntax, etc)
        transform - if true then executes transformations
        inline - whether the content should be parsed as inline content (not top level paragraph, etc)
        Returns:
        the result as a Blocks
        Throws:
        MacroExecutionException - in case of a parsing error
      • parse

        XDOM parse​(String content,
                   MacroTransformationContext macroContext,
                   boolean transform,
                   MetaData metadata,
                   boolean inline)
            throws MacroExecutionException
        Parses content of a macro field (parameter, macro content) in a given syntax and optionally remove the top level paragraph.
        Parameters:
        content - the content to parse
        macroContext - the executing Macro context (from which to get the current syntax, etc)
        transform - if true then executes transformations
        metadata - the metadata to add to the XDOM before executing transformations
        inline - whether the content should be parsed as inline content (not top level paragraph, etc)
        Returns:
        the result as a Blocks
        Throws:
        MacroExecutionException - in case of a parsing error
        Since:
        6.4
      • getCurrentSyntax

        Syntax getCurrentSyntax​(MacroTransformationContext context)
        Find the current syntax to use for macro supporting wiki content/parameters/whatever.
        Parameters:
        context - the macro execution context containing the default syntax and the current macro block
        Returns:
        the current syntax