org.xwiki.rendering.macro.box
Class AbstractBoxMacro<P extends BoxMacroParameters>

java.lang.Object
  extended by org.xwiki.component.logging.AbstractLogEnabled
      extended by org.xwiki.rendering.macro.AbstractMacro<P>
          extended by org.xwiki.rendering.macro.box.AbstractBoxMacro<P>
Type Parameters:
P - the type of macro parameters bean.
All Implemented Interfaces:
java.lang.Comparable<Macro<?>>, org.xwiki.component.phase.Initializable, org.xwiki.component.phase.LogEnabled, Macro<P>

public abstract class AbstractBoxMacro<P extends BoxMacroParameters>
extends AbstractMacro<P>

Draw a box around provided content.

Since:
1.7
Version:
$Id$

Field Summary
 
Fields inherited from class org.xwiki.rendering.macro.AbstractMacro
beanManager, DEFAULT_CATEGORY_CONTENT, DEFAULT_CATEGORY_DEVELOPMENT, DEFAULT_CATEGORY_FORMATTING, DEFAULT_CATEGORY_NAVIGATION
 
Constructor Summary
protected AbstractBoxMacro(java.lang.String name, java.lang.String description, ContentDescriptor contentDescriptor, java.lang.Class<?> parametersBeanClass)
          Creates a new box macro.
 
Method Summary
 java.util.List<Block> execute(P parameters, java.lang.String content, MacroTransformationContext context)
          
protected  java.lang.String getClassProperty()
           
protected  org.xwiki.rendering.internal.macro.MacroContentParser getMacroContentParser()
           
protected abstract  java.util.List<Block> parseContent(P parameters, java.lang.String content, MacroTransformationContext context)
          Execute macro content and return the result.
 boolean supportsInlineMode()
          
 
Methods inherited from class org.xwiki.rendering.macro.AbstractMacro
compareTo, getDescriptor, getPriority, initialize, setDefaultCategory, setDescriptor, setPriority
 
Methods inherited from class org.xwiki.component.logging.AbstractLogEnabled
enableLogging, getLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractBoxMacro

protected AbstractBoxMacro(java.lang.String name,
                           java.lang.String description,
                           ContentDescriptor contentDescriptor,
                           java.lang.Class<?> parametersBeanClass)
Creates a new box macro.

Parameters:
name - the name of the macro
description - string describing this macro.
contentDescriptor - the ContentDescriptor describing the content of this macro.
parametersBeanClass - class of the parameters bean.
Method Detail

supportsInlineMode

public boolean supportsInlineMode()

See Also:
Macro.supportsInlineMode()

execute

public java.util.List<Block> execute(P parameters,
                                     java.lang.String content,
                                     MacroTransformationContext context)
                              throws MacroExecutionException

Throws:
MacroExecutionException
See Also:
Macro.execute(Object, String, MacroTransformationContext)

parseContent

protected abstract java.util.List<Block> parseContent(P parameters,
                                                      java.lang.String content,
                                                      MacroTransformationContext context)
                                               throws MacroExecutionException
Execute macro content and return the result. This methods is separated form execute(BoxMacroParameters, String, MacroTransformationContext) to be able to overwrite it in macro which need boxes.

Parameters:
parameters - the parameters of the macro.
content - the content of the macro.
context - the context if the macros transformation.
Returns:
the result of the macro execution.
Throws:
MacroExecutionException - error when executing the macro.

getClassProperty

protected java.lang.String getClassProperty()
Returns:
the name of the CSS class to use when rendering, in case no cssClass parameter is specified.

getMacroContentParser

protected org.xwiki.rendering.internal.macro.MacroContentParser getMacroContentParser()
Returns:
the macro content parser to use to parse content in wiki syntax


Copyright © 2004-2011 XWiki. All Rights Reserved.