org.xwiki.rendering.internal.macro
Class DefaultMacroContentParser

java.lang.Object
  extended by org.xwiki.rendering.internal.macro.DefaultMacroContentParser
All Implemented Interfaces:
MacroContentParser

@Component
@Singleton
public class DefaultMacroContentParser
extends Object
implements MacroContentParser

Default implementation for MacroContentParser.

Since:
3.0M1
Version:
$Id$

Constructor Summary
DefaultMacroContentParser()
           
 
Method Summary
protected  Syntax getCurrentSyntax(MacroTransformationContext context)
          Find the current syntax to use for macro supporting wiki content/parameters/whatever.
 List<Block> parse(String content, MacroTransformationContext macroContext, boolean transform, boolean removeTopLevelParagraph)
          Parses content of a macro field (parameter, macro content) in a given syntax and optionally remove the top level paragraph.
 XDOM parseXDOM(String content, MacroTransformationContext macroContext, boolean transform, boolean removeTopLevelParagraph)
          Parses content of a macro field (parameter, macro content) in a given syntax and optionally remove the top level paragraph.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultMacroContentParser

public DefaultMacroContentParser()
Method Detail

parse

public List<Block> parse(String content,
                         MacroTransformationContext macroContext,
                         boolean transform,
                         boolean removeTopLevelParagraph)
                  throws MacroExecutionException
Parses content of a macro field (parameter, macro content) in a given syntax and optionally remove the top level paragraph.

Specified by:
parse in interface MacroContentParser
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
removeTopLevelParagraph - whether the top level paragraph should be removed after parsing
Returns:
the result as a Blocks
Throws:
MacroExecutionException - in case of a parsing error
See Also:
MacroContentParser.parse(String, MacroTransformationContext, boolean, boolean)

parseXDOM

public XDOM parseXDOM(String content,
                      MacroTransformationContext macroContext,
                      boolean transform,
                      boolean removeTopLevelParagraph)
               throws MacroExecutionException
Parses content of a macro field (parameter, macro content) in a given syntax and optionally remove the top level paragraph.

Specified by:
parseXDOM in interface MacroContentParser
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
removeTopLevelParagraph - whether the top level paragraph should be removed after parsing
Returns:
the result as a Blocks
Throws:
MacroExecutionException - in case of a parsing error
See Also:
MacroContentParser.parseXDOM(java.lang.String, org.xwiki.rendering.transformation.MacroTransformationContext, boolean, boolean)

getCurrentSyntax

protected 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


Copyright © 2004-2011 XWiki. All Rights Reserved.