Package org.xwiki.rendering.macro
Interface MacroContentParser
-
@Role public interface MacroContentParserParses content of a macro field (parameter, macro content) in a given syntax.- Since:
- 3.3M1
- Version:
- $Id: 1fbde4f523d9fc672eef9fc8b104b97e8136f5a3 $
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description SyntaxgetCurrentSyntax(MacroTransformationContext context)Find the current syntax to use for macro supporting wiki content/parameters/whatever.default XDOMparse(String content, Syntax syntax, MacroTransformationContext macroContext, boolean transform, MetaData metadata, boolean inline)Parses content of a macro field (parameter, macro content) in a given syntax and optionally remove the top level paragraph.XDOMparse(String content, MacroTransformationContext macroContext, boolean transform, boolean inline)Parses content of a macro field (parameter, macro content) in a given syntax and optionally remove the top level paragraph.XDOMparse(String content, MacroTransformationContext macroContext, boolean transform, MetaData metadata, boolean inline)Parses content of a macro field (parameter, macro content) in a given syntax and optionally remove the top level paragraph.
-
-
-
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 parsemacroContext- the executing Macro context (from which to get the current syntax, etc)transform- if true then executes transformationsinline- 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 parsemacroContext- the executing Macro context (from which to get the current syntax, etc)transform- if true then executes transformationsmetadata- the metadata to add to the XDOM before executing transformationsinline- 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 parsesyntax- the syntax of the content or null if the context one should be usedmacroContext- the executing Macro context (from which to get the current syntax, etc)transform- if true then executes transformationsmetadata- the metadata to add to the XDOM before executing transformationsinline- 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
-
-