org.xwiki.rendering.internal.macro.wikibridge
Class DefaultWikiMacro

java.lang.Object
  extended by org.xwiki.rendering.internal.macro.wikibridge.DefaultWikiMacro
All Implemented Interfaces:
java.lang.Comparable<org.xwiki.rendering.macro.Macro<?>>, NestedScriptMacroEnabled, org.xwiki.rendering.macro.Macro<WikiMacroParameters>, WikiMacro

public class DefaultWikiMacro
extends java.lang.Object
implements WikiMacro, NestedScriptMacroEnabled

Default implementation of WikiMacro.

Since:
2.0M1
Version:
$Id$

Constructor Summary
DefaultWikiMacro(DocumentReference macroDocumentReference, boolean supportsInlineMode, org.xwiki.rendering.macro.descriptor.MacroDescriptor descriptor, org.xwiki.rendering.block.XDOM macroContent, org.xwiki.rendering.syntax.Syntax syntax, org.xwiki.component.manager.ComponentManager componentManager)
          Constructs a new DefaultWikiMacro.
 
Method Summary
 int compareTo(org.xwiki.rendering.macro.Macro<?> macro)
          
 java.util.List<org.xwiki.rendering.block.Block> execute(WikiMacroParameters parameters, java.lang.String macroContent, org.xwiki.rendering.transformation.MacroTransformationContext context)
          
 org.xwiki.rendering.macro.descriptor.MacroDescriptor getDescriptor()
          
 DocumentReference getDocumentReference()
          
 java.lang.String getId()
          
 int getPriority()
          
 boolean supportsInlineMode()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultWikiMacro

public DefaultWikiMacro(DocumentReference macroDocumentReference,
                        boolean supportsInlineMode,
                        org.xwiki.rendering.macro.descriptor.MacroDescriptor descriptor,
                        org.xwiki.rendering.block.XDOM macroContent,
                        org.xwiki.rendering.syntax.Syntax syntax,
                        org.xwiki.component.manager.ComponentManager componentManager)
Constructs a new DefaultWikiMacro.

Parameters:
macroDocumentReference - the name of the document which contains the definition of this macro
supportsInlineMode - says if macro support inline mode or not
descriptor - the MacroDescriptor describing this macro.
macroContent - macro content to be evaluated.
syntax - syntax of the macroContent source.
componentManager - ComponentManager component used to look up for other components.
Since:
2.3M1
Method Detail

execute

public java.util.List<org.xwiki.rendering.block.Block> execute(WikiMacroParameters parameters,
                                                               java.lang.String macroContent,
                                                               org.xwiki.rendering.transformation.MacroTransformationContext context)
                                                        throws org.xwiki.rendering.macro.MacroExecutionException

Specified by:
execute in interface org.xwiki.rendering.macro.Macro<WikiMacroParameters>
Throws:
org.xwiki.rendering.macro.MacroExecutionException
See Also:
Macro.execute(Object, String, MacroTransformationContext)

getDescriptor

public org.xwiki.rendering.macro.descriptor.MacroDescriptor getDescriptor()

Specified by:
getDescriptor in interface org.xwiki.rendering.macro.Macro<WikiMacroParameters>

getPriority

public int getPriority()

Specified by:
getPriority in interface org.xwiki.rendering.macro.Macro<WikiMacroParameters>

getId

public java.lang.String getId()

Specified by:
getId in interface WikiMacro
Returns:
the id under which this macro is registered with the component manager

getDocumentReference

public DocumentReference getDocumentReference()

Specified by:
getDocumentReference in interface WikiMacro
Returns:
the DocumentReference of the Wiki Macro

compareTo

public int compareTo(org.xwiki.rendering.macro.Macro<?> macro)

Specified by:
compareTo in interface java.lang.Comparable<org.xwiki.rendering.macro.Macro<?>>

supportsInlineMode

public boolean supportsInlineMode()

Specified by:
supportsInlineMode in interface org.xwiki.rendering.macro.Macro<WikiMacroParameters>


Copyright © 2004-2011 XWiki. All Rights Reserved.