Interface MacroContentParser


  • @Role
    public interface MacroContentParser
    Parses content of a macro field (parameter, macro content) in a given syntax.
    Since:
    3.3M1
    Version:
    $Id: 1fbde4f523d9fc672eef9fc8b104b97e8136f5a3 $
    • 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
      • parse

        @Unstable
        default XDOM parse​(String content,
                           Syntax syntax,
                           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
        syntax - the syntax of the content or null if the context one should be used
        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:
        15.1RC1, 14.10.5
      • 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