P
- the type of macro parameters bean.public abstract class AbstractBoxMacro<P extends BoxMacroParameters> extends AbstractMacro<P>
Modifier and Type | Field and Description |
---|---|
static String |
CONTENT_MISSING_ERROR
Predefined error message.
|
beanManager, DEFAULT_CATEGORY_CONTENT, DEFAULT_CATEGORY_DEVELOPMENT, DEFAULT_CATEGORY_FORMATTING, DEFAULT_CATEGORY_INTERNAL, DEFAULT_CATEGORY_LAYOUT, DEFAULT_CATEGORY_NAVIGATION
Modifier | Constructor and Description |
---|---|
protected |
AbstractBoxMacro(String name,
String description,
ContentDescriptor contentDescriptor,
Class<?> parametersBeanClass)
Creates a new box macro.
|
Modifier and Type | Method and Description |
---|---|
List<Block> |
execute(P parameters,
String content,
MacroTransformationContext context) |
protected List<? extends Block> |
getBlockTitle(P parameters,
String content,
MacroTransformationContext context) |
protected Map<String,String> |
getBoxParameters(P parameters,
String content,
MacroTransformationContext context) |
protected String |
getClassProperty() |
protected ResourceReference |
getImageReference(P parameters,
String content,
MacroTransformationContext context) |
protected MacroContentParser |
getMacroContentParser() |
protected String |
getTitle(P parameters,
String content,
MacroTransformationContext context) |
protected abstract List<Block> |
parseContent(P parameters,
String content,
MacroTransformationContext context)
Execute macro content and return the result.
|
boolean |
supportsInlineMode() |
compareTo, getDescriptor, getNonGeneratedContentMetaData, getNonGeneratedContentMetaData, getNonGeneratedContentMetaData, getNonGeneratedContentMetaData, getPriority, initialize, setDefaultCategory, setDescriptor, setPriority
public static final String CONTENT_MISSING_ERROR
protected AbstractBoxMacro(String name, String description, ContentDescriptor contentDescriptor, Class<?> parametersBeanClass)
name
- the name of the macrodescription
- string describing this macro.contentDescriptor
- the ContentDescriptor
describing the content of this macro.parametersBeanClass
- class of the parameters bean.public boolean supportsInlineMode()
@Unstable protected List<? extends Block> getBlockTitle(P parameters, String content, MacroTransformationContext context)
parameters
- the macro parameters in the form of a bean defined by the Macro
implementationcontent
- the content of the macrocontext
- the context of the macros transformation process@Unstable protected ResourceReference getImageReference(P parameters, String content, MacroTransformationContext context)
parameters
- the macro parameters in the form of a bean defined by the Macro
implementationcontent
- the content of the macrocontext
- the context of the macros transformation process@Unstable protected String getTitle(P parameters, String content, MacroTransformationContext context)
parameters
- the macro parameters in the form of a bean defined by the Macro
implementationcontent
- the content of the macrocontext
- the context of the macros transformation process@Unstable protected Map<String,String> getBoxParameters(P parameters, String content, MacroTransformationContext context)
parameters
- the macro parameters in the form of a bean defined by the Macro
implementationcontent
- the content of the macrocontext
- the context of the macros transformation processpublic List<Block> execute(P parameters, String content, MacroTransformationContext context) throws MacroExecutionException
MacroExecutionException
protected abstract List<Block> parseContent(P parameters, String content, MacroTransformationContext context) throws MacroExecutionException
execute(BoxMacroParameters, String, MacroTransformationContext)
to be able to overwrite it in macro
which need boxes.parameters
- the parameters of the macro.content
- the content of the macro.context
- the context if the macros transformation.MacroExecutionException
- error when executing the macro.protected String getClassProperty()
protected MacroContentParser getMacroContentParser()
Copyright © 2004–2019 XWiki. All rights reserved.