P
- the type of the macro parameters beanpublic abstract class AbstractMacro<P> extends Object implements Macro<P>, org.xwiki.component.phase.Initializable
Modifier and Type | Field and Description |
---|---|
protected org.xwiki.properties.BeanManager |
beanManager
The
BeanManager component. |
static String |
DEFAULT_CATEGORY_CONTENT
"Content" default macro category.
|
static String |
DEFAULT_CATEGORY_DEVELOPMENT
"Development" default macro category.
|
static String |
DEFAULT_CATEGORY_FORMATTING
"Formatting" default macro category.
|
static String |
DEFAULT_CATEGORY_INTERNAL
"Internal" default macro category.
|
static String |
DEFAULT_CATEGORY_LAYOUT
"Layout" default macro category.
|
static String |
DEFAULT_CATEGORY_NAVIGATION
"Navigation" default macro category.
|
Constructor and Description |
---|
AbstractMacro(String name)
Creates a new
Macro instance. |
AbstractMacro(String name,
String description)
Creates a new
Macro instance. |
AbstractMacro(String name,
String description,
Class<?> parametersBeanClass)
Creates a new
Macro instance. |
AbstractMacro(String name,
String description,
ContentDescriptor contentDescriptor)
Creates a new
Macro instance. |
AbstractMacro(String name,
String description,
ContentDescriptor contentDescriptor,
Class<?> parametersBeanClass)
Creates a new
Macro instance. |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Macro<?> macro) |
MacroDescriptor |
getDescriptor() |
protected MetaData |
getNonGeneratedContentMetaData()
Helper to get the proper metadata for non generated content (i.e.
|
static MetaData |
getNonGeneratedContentMetaData(ContentDescriptor contentDescriptor)
Helper to get the proper metadata for non generated content (i.e.
|
static MetaData |
getNonGeneratedContentMetaData(Map<String,ParameterDescriptor> parameterDescriptorMap,
String name)
Helper to get the proper metadata for non generated content (i.e.
|
protected MetaData |
getNonGeneratedContentMetaData(String parameterName)
Helper to get the proper metadata for non generated content (i.e.
|
int |
getPriority()
The priority of execution relative to the other Macros.
|
void |
initialize() |
protected void |
setDefaultCategory(String defaultCategory)
Allows sub classes to set the default macro category.
|
protected void |
setDescriptor(MacroDescriptor descriptor)
Allows macro classes extending other macro classes to override the macro descriptor with their own.
|
void |
setPriority(int priority) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
execute, supportsInlineMode
public static final String DEFAULT_CATEGORY_FORMATTING
public static final String DEFAULT_CATEGORY_DEVELOPMENT
public static final String DEFAULT_CATEGORY_CONTENT
public static final String DEFAULT_CATEGORY_NAVIGATION
public static final String DEFAULT_CATEGORY_INTERNAL
public static final String DEFAULT_CATEGORY_LAYOUT
@Inject protected org.xwiki.properties.BeanManager beanManager
BeanManager
component.public AbstractMacro(String name)
Macro
instance.name
- the name of the macro (eg "Table Of Contents" for the TOC macro)public AbstractMacro(String name, String description)
Macro
instance.name
- the name of the macro (eg "Table Of Contents" for the TOC macro)description
- a string describing this macro.public AbstractMacro(String name, String description, ContentDescriptor contentDescriptor)
Macro
instance.name
- the name of the macro (eg "Table Of Contents" for the TOC macro)description
- a string describing this macro.contentDescriptor
- ContentDescriptor
for this macro.public AbstractMacro(String name, String description, Class<?> parametersBeanClass)
Macro
instance.name
- the name of the macro (eg "Table Of Contents" for the TOC macro)description
- a string describing this macro.parametersBeanClass
- class of the parameters bean of this macro.public AbstractMacro(String name, String description, ContentDescriptor contentDescriptor, Class<?> parametersBeanClass)
Macro
instance.name
- the name of the macro (eg "Table Of Contents" for the TOC macro)description
- string describing this macro.contentDescriptor
- the ContentDescriptor
describing the content of this macro.parametersBeanClass
- class of the parameters bean.public void initialize() throws org.xwiki.component.phase.InitializationException
initialize
in interface org.xwiki.component.phase.Initializable
org.xwiki.component.phase.InitializationException
public int getPriority()
Macro
getPriority
in interface Macro<P>
public void setPriority(int priority)
priority
- the macro priority to use (lower means execute before others)public MacroDescriptor getDescriptor()
getDescriptor
in interface Macro<P>
public int compareTo(Macro<?> macro)
compareTo
in interface Comparable<Macro<?>>
protected void setDescriptor(MacroDescriptor descriptor)
descriptor
- the overriding descriptor to setprotected void setDefaultCategory(String defaultCategory)
MacroDescriptor
is of type AbstractMacroDescriptor
.defaultCategory
- the default macro category to be set.public static MetaData getNonGeneratedContentMetaData(ContentDescriptor contentDescriptor)
contentDescriptor
- the ContentDescriptor
from which to get the type for the metadata.java.util.List<org.xwiki.rendering.block.Block>
for content of type List<Block>
protected MetaData getNonGeneratedContentMetaData()
java.util.List<org.xwiki.rendering.block.Block>
for content of type List<Block>
public static MetaData getNonGeneratedContentMetaData(Map<String,ParameterDescriptor> parameterDescriptorMap, String name)
parameterDescriptorMap
- the descriptor map of the parametersname
- the name of the parameter for which to get the metadatajava.util.List<org.xwiki.rendering.block.Block>
for content of type List<Block>
protected MetaData getNonGeneratedContentMetaData(String parameterName)
parameterName
- the name of the parameter as defined in the macrojava.util.List<org.xwiki.rendering.block.Block>
for content of type List<Block>
Copyright © 2004–2022 XWiki. All rights reserved.