com.atlassian.confluence.macro.browser.beans
Class MacroParameter

java.lang.Object
  extended by com.atlassian.confluence.macro.browser.beans.MacroParameter
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
GadgetMacroParameter

public class MacroParameter
extends Object
implements Serializable

Represents parameter metadata for a macro.

See Also:
Serialized Form

Constructor Summary
MacroParameter(String pluginKey, String macroName, String name, MacroParameterType type, boolean required, boolean multiple, String defaultValue, boolean hidden)
           
MacroParameter(String pluginKey, String macroName, String name, MacroParameterType type, boolean required, boolean multiple, String defaultValue, boolean hidden, String documentationUrl)
           
 
Method Summary
 void addAlias(String alias)
          Adds an alias name for the parameter.
 void addEnumValue(String value)
          Adds an enum value to the paramter.
 void addOption(String key, String value)
          Adds an option key/value pair for this parameter.
 void addOptions(Map<String,String> options)
           
 Set<String> getAliases()
           
 String getDefaultValue()
          Returns the default value of the parameter.
 Message getDescription()
           
 Message getDisplayName()
           
 List<String> getEnumValues()
          Returns a list of enum values.
 String getName()
           
 Properties getOptions()
           
 MacroParameterType getType()
           
 boolean isHidden()
          Whether or not to hide the macro parameter from display in the macro browser.
 boolean isMultiple()
           
 boolean isRequired()
           
 void setDescription(String description)
           
 void setDisplayName(String displayName)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MacroParameter

public MacroParameter(String pluginKey,
                      String macroName,
                      String name,
                      MacroParameterType type,
                      boolean required,
                      boolean multiple,
                      String defaultValue,
                      boolean hidden)

MacroParameter

public MacroParameter(String pluginKey,
                      String macroName,
                      String name,
                      MacroParameterType type,
                      boolean required,
                      boolean multiple,
                      String defaultValue,
                      boolean hidden,
                      String documentationUrl)
Method Detail

isHidden

public boolean isHidden()
Whether or not to hide the macro parameter from display in the macro browser.


addAlias

public void addAlias(String alias)
Adds an alias name for the parameter.


addEnumValue

public void addEnumValue(String value)
Adds an enum value to the paramter. If the parameter is not of type enum, it is ignored.


addOptions

public void addOptions(Map<String,String> options)

addOption

public void addOption(String key,
                      String value)
Adds an option key/value pair for this parameter.


getName

public String getName()

getType

public MacroParameterType getType()

getDefaultValue

public String getDefaultValue()
Returns the default value of the parameter. Null is returned if there is no default value defined except for MacroParameterType.BOOLEAN type parameters; in which case "false" is returned.


isRequired

public boolean isRequired()
Returns:
true if the parameter is required for the macro.

isMultiple

public boolean isMultiple()
Returns:
true if the parameter allows multiple values.

getAliases

public Set<String> getAliases()
Returns:
a Set of Strings that are aliases for this macro parameter name.

getEnumValues

public List<String> getEnumValues()
Returns a list of enum values. Null is returned if the parameter is not of type enum.


getOptions

public Properties getOptions()

getDisplayName

public Message getDisplayName()

getDescription

public Message getDescription()

toString

public String toString()
Overrides:
toString in class Object

setDisplayName

public void setDisplayName(String displayName)

setDescription

public void setDescription(String description)


Copyright © 2003-2011 Atlassian. All Rights Reserved.