com.atlassian.configurable
Class ObjectConfigurationPropertyImpl

java.lang.Object
  extended by com.atlassian.configurable.ObjectConfigurationPropertyImpl
All Implemented Interfaces:
ObjectConfigurationProperty, java.util.Map
Direct Known Subclasses:
ValuesGeneratorObjectConfigurationProperty, XMLValuesObjectConfigurationProperty

public class ObjectConfigurationPropertyImpl
extends java.lang.Object
implements ObjectConfigurationProperty

This interface is a property of an Object Configuration and contains a name, description, default value and the type (ObjectConfigurationTypes) of this property. It can also contain a list of values if the type has values specified for it e.g. select list.


Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Method Summary
 void clear()
          Object Configuration Properties are immutable so this function throws an exception
 boolean containsKey(java.lang.Object key)
          Does this property have a choice with key of the specified value
 boolean containsValue(java.lang.Object value)
          Does this property have a choice with value of the specified value
 java.util.Set entrySet()
          Entry set of the choices for this property
 java.lang.Object get(java.lang.Object key)
          Returns the value of the choice that matches key
 java.lang.String getCascadeFrom()
           
 java.lang.String getDefault()
          Retreives the default value of this Property e.g.
 java.lang.String getDescription()
          Retrieves the description of this Property e.g.
protected  java.util.Map getInternalValues(java.util.Map userParams)
          Returns the map of values stored internally for the choices of this property.
protected  java.util.Map getMutableInternalValues()
           
 java.lang.String getName()
          Retrieves the name of this Property e.g.
 int getType()
          Retrieves the type of the Property e.g.
 void init(java.util.Map userParams)
          This is a list of user parameters that may be required to generate a list of values and/or a description for this Property.
 boolean isEmpty()
          Does this property have a number of possible choices
 boolean isEnabled()
          Whether the property is enabled in the current context.
 boolean isI18nValues()
           
 java.util.Set keySet()
          Returns a set of the key for the choices for this property
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
          Object Configuration Properties are immutable so this function throws an exception
 void putAll(java.util.Map t)
          Object Configuration Properties are immutable so this function throws an exception
 java.lang.Object remove(java.lang.Object key)
          Object Configuration Properties are immutable so this function throws an exception
 void setCascadeFrom(java.lang.String cascadeFrom)
           
 void setI18nValues(boolean i18nValues)
           
 int size()
          If this Property has a list of choices e.g.
 java.util.Collection values()
          Returns all the calues for the choices of this property
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Method Detail

init

public void init(java.util.Map userParams)
This is a list of user parameters that may be required to generate a list of values and/or a description for this Property. e.g. a User may be required to generate a list of values they can see but other users can not.

Specified by:
init in interface ObjectConfigurationProperty
Parameters:
userParams - Parameters used to generate a list of values and/or a description

getName

public java.lang.String getName()
Retrieves the name of this Property e.g. City

Specified by:
getName in interface ObjectConfigurationProperty
Returns:
Name of this Property

getDescription

public java.lang.String getDescription()
Retrieves the description of this Property e.g. Please enter you current location

Specified by:
getDescription in interface ObjectConfigurationProperty
Returns:
Description of the Property

getDefault

public java.lang.String getDefault()
Retreives the default value of this Property e.g. Sydney

Specified by:
getDefault in interface ObjectConfigurationProperty
Returns:
Default value of Property

getType

public int getType()
Retrieves the type of the Property e.g. Text

Specified by:
getType in interface ObjectConfigurationProperty
Returns:
Type of property from ObjectConfigurationTypes

isEnabled

public boolean isEnabled()
Description copied from interface: ObjectConfigurationProperty
Whether the property is enabled in the current context. It is up to the implementation to divine the context.

Specified by:
isEnabled in interface ObjectConfigurationProperty
Returns:
true only if the property is enabled.

size

public int size()
If this Property has a list of choices e.g. a select list then this function returns how many there are. If there are no choices it returns 0

Specified by:
size in interface java.util.Map
Returns:
Number of choices for this properties value

isEmpty

public boolean isEmpty()
Does this property have a number of possible choices

Specified by:
isEmpty in interface java.util.Map
Returns:
Does this property have a number of possible values

containsKey

public boolean containsKey(java.lang.Object key)
Does this property have a choice with key of the specified value

Specified by:
containsKey in interface java.util.Map
Parameters:
key - Does this Property have a choice with key, key
Returns:
Has Key

containsValue

public boolean containsValue(java.lang.Object value)
Does this property have a choice with value of the specified value

Specified by:
containsValue in interface java.util.Map
Parameters:
value - Does this Property have a choice with value, value
Returns:
Has Value

get

public java.lang.Object get(java.lang.Object key)
Returns the value of the choice that matches key

Specified by:
get in interface java.util.Map
Parameters:
key - Key look for
Returns:
value for key, key

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
Object Configuration Properties are immutable so this function throws an exception

Specified by:
put in interface java.util.Map

remove

public java.lang.Object remove(java.lang.Object key)
Object Configuration Properties are immutable so this function throws an exception

Specified by:
remove in interface java.util.Map

putAll

public void putAll(java.util.Map t)
Object Configuration Properties are immutable so this function throws an exception

Specified by:
putAll in interface java.util.Map

clear

public void clear()
Object Configuration Properties are immutable so this function throws an exception

Specified by:
clear in interface java.util.Map

keySet

public java.util.Set keySet()
Returns a set of the key for the choices for this property

Specified by:
keySet in interface java.util.Map
Returns:
Set of keys

values

public java.util.Collection values()
Returns all the calues for the choices of this property

Specified by:
values in interface java.util.Map
Returns:
Collection of values

entrySet

public java.util.Set entrySet()
Entry set of the choices for this property

Specified by:
entrySet in interface java.util.Map
Returns:
Entry Set

isI18nValues

public boolean isI18nValues()
Specified by:
isI18nValues in interface ObjectConfigurationProperty

setI18nValues

public void setI18nValues(boolean i18nValues)
Specified by:
setI18nValues in interface ObjectConfigurationProperty

getCascadeFrom

public java.lang.String getCascadeFrom()
Specified by:
getCascadeFrom in interface ObjectConfigurationProperty

setCascadeFrom

public void setCascadeFrom(java.lang.String cascadeFrom)
Specified by:
setCascadeFrom in interface ObjectConfigurationProperty

getInternalValues

protected java.util.Map getInternalValues(java.util.Map userParams)
Returns the map of values stored internally for the choices of this property.

Parameters:
userParams - Not used in this implementation.
Returns:
Map of choices

getMutableInternalValues

protected java.util.Map getMutableInternalValues()
Returns:
the map of values stored internally for the choices of this property as a mutable Map.
Since:
29 August 2007 for JIRA 3.11


Copyright © 2002-2010 Atlassian. All Rights Reserved.