org.xwiki.rendering.macro.descriptor
Class AbstractMacroDescriptor

java.lang.Object
  extended by org.xwiki.rendering.macro.descriptor.AbstractMacroDescriptor
All Implemented Interfaces:
MacroDescriptor
Direct Known Subclasses:
DefaultMacroDescriptor

public abstract class AbstractMacroDescriptor
extends Object
implements MacroDescriptor

Describe a macro.

Since:
1.6M1
Version:
$Id: 5568b6418c14407b41960801fd13993bf7ed5094 $

Constructor Summary
AbstractMacroDescriptor(MacroId id, String name, String description, ContentDescriptor contentDescriptor, org.xwiki.properties.BeanDescriptor parametersBeanDescriptor)
           
AbstractMacroDescriptor(String name, String description, ContentDescriptor contentDescriptor, org.xwiki.properties.BeanDescriptor parametersBeanDescriptor)
          Deprecated. since 2.3M1 use AbstractMacroDescriptor(MacroId, String, String, ContentDescriptor, BeanDescriptor) instead
 
Method Summary
protected  void extractParameterDescriptorMap()
          Extract parameters informations from parametersBeanDescriptor and insert it in parameterDescriptorMap.
 ContentDescriptor getContentDescriptor()
           
 String getDefaultCategory()
          A macro can define a default classification category under which it falls.
 String getDescription()
           
 MacroId getId()
          
 String getName()
          
 Map<String,ParameterDescriptor> getParameterDescriptorMap()
           
 Class<?> getParametersBeanClass()
           
 void setDefaultCategory(String defaultCategory)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractMacroDescriptor

public AbstractMacroDescriptor(MacroId id,
                               String name,
                               String description,
                               ContentDescriptor contentDescriptor,
                               org.xwiki.properties.BeanDescriptor parametersBeanDescriptor)
Parameters:
id - the id of the macro
name - the name of the macro (eg "Table Of Contents" for the TOC macro)
description - the description of the macro.
contentDescriptor - the description of the macro content. null indicate macro does not support content.
parametersBeanDescriptor - the description of the parameters bean or null if there are no parameters for this macro.
Since:
2.3M1

AbstractMacroDescriptor

@Deprecated
public AbstractMacroDescriptor(String name,
                                          String description,
                                          ContentDescriptor contentDescriptor,
                                          org.xwiki.properties.BeanDescriptor parametersBeanDescriptor)
Deprecated. since 2.3M1 use AbstractMacroDescriptor(MacroId, String, String, ContentDescriptor, BeanDescriptor) instead

Parameters:
name - the name of the macro (eg "Table Of Contents" for the TOC macro)
description - the description of the macro.
contentDescriptor - the description of the macro content. null indicate macro does not support content.
parametersBeanDescriptor - the description of the parameters bean or null if there are no parameters for this macro.
Since:
2.0M3
Method Detail

extractParameterDescriptorMap

protected void extractParameterDescriptorMap()
Extract parameters informations from parametersBeanDescriptor and insert it in parameterDescriptorMap.

Since:
1.7M2

getId

public MacroId getId()

Specified by:
getId in interface MacroDescriptor
Returns:
the id of the macro
Since:
2.3M1

getName

public String getName()

Specified by:
getName in interface MacroDescriptor
Returns:
the human-readable name of the macro (eg "Table Of Contents" for the TOC macro).
Since:
2.0M3

getContentDescriptor

public ContentDescriptor getContentDescriptor()
Specified by:
getContentDescriptor in interface MacroDescriptor
Returns:
describe the macro content. If null the macro does not support content.

getDescription

public String getDescription()
Specified by:
getDescription in interface MacroDescriptor
Returns:
the description of the macro.

getParametersBeanClass

public Class<?> getParametersBeanClass()
Specified by:
getParametersBeanClass in interface MacroDescriptor
Returns:
the class of the JAVA bean containing macro parameters.

getParameterDescriptorMap

public Map<String,ParameterDescriptor> getParameterDescriptorMap()
Specified by:
getParameterDescriptorMap in interface MacroDescriptor
Returns:
a Map containing the ParameterDescriptor for each parameter.

getDefaultCategory

public String getDefaultCategory()
Description copied from interface: MacroDescriptor
A macro can define a default classification category under which it falls. For an example, the "skype" macro would fall under the "Communication" category of macros. However, a wiki administrator has the ability to override the default category for a given macro in order to organize categories as he sees fit. Thus this default category is only an indication from the macro author about what category the macro should fall.

Specified by:
getDefaultCategory in interface MacroDescriptor
Returns:
the default category under which this macro should be listed or null if the macro doesn't have a default category defined

setDefaultCategory

public void setDefaultCategory(String defaultCategory)
Parameters:
defaultCategory - default category under which this macro should be listed.
See Also:
MacroDescriptor.getDefaultCategory()


Copyright © 2004–2015 XWiki. All rights reserved.