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_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() |
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, waitexecute, supportsInlineModepublic 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
@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.Initializableorg.xwiki.component.phase.InitializationExceptionpublic int getPriority()
MacrogetPriority 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.Copyright © 2004–2017 XWiki. All rights reserved.