public class PrioritizedCompositePropertySet
extends com.opensymphony.module.propertyset.AbstractPropertySet
PropertySets
into a unified view of the underlying properties. The order of the underlying PropertySets is significant and affects
the value that is returned for a particular property key. The first PropertySet that contains the value is the holder
of the official value.
Note however that if any underlying PropertySet defines a particular key as read-only, then that property will be
read-only, even though a higher PropertySet may be read-write. This is done to preserve the contract of the
PropertySet interface, in particular the semantics of remove(String)
which otherwise would not actually
remove the property but allow the previously shadowed value to be returned.Modifier and Type | Method and Description |
---|---|
boolean |
exists(String key)
Does a property exist in the delegated property sets in order.
|
protected Object |
get(int type,
String key)
Copied from
com.opensymphony.module.propertyset.aggregate.AggregatePropertySet and modified to perform
the get operation on the highest property set. |
Collection |
getKeys(String prefix,
int type)
Returns a collection of keys that are retrieved from all providers.
|
int |
getType(String key)
Returns the type of the property.
|
boolean |
isSettable(String property)
Determine whether the delegates will allow the property to be set.
|
void |
remove(String key)
Remove property with given key from all underlying property sets.It removes the property from all property sets.
|
protected void |
setImpl(int type,
String key,
Object value)
Copied from
com.opensymphony.module.propertyset.aggregate.AggregatePropertySet and modified to perform
the set operation on the highest property set. |
getAsActualType, getBoolean, getData, getDate, getDouble, getInt, getKeys, getKeys, getKeys, getLong, getObject, getProperties, getSchema, getString, getText, getXML, init, setAsActualType, setBoolean, setData, setDate, setDouble, setInt, setLong, setObject, setProperties, setSchema, setString, setText, setXML, supportsType, supportsTypes, toString, type, type
public Collection getKeys(String prefix, int type) throws com.opensymphony.module.propertyset.PropertyException
getKeys
in interface com.opensymphony.module.propertyset.PropertySet
getKeys
in class com.opensymphony.module.propertyset.AbstractPropertySet
prefix
- prefixtype
- property typecom.opensymphony.module.propertyset.PropertyException
- if any of the delegated property sets throws itpublic int getType(String key) throws com.opensymphony.module.propertyset.PropertyException
getType
in interface com.opensymphony.module.propertyset.PropertySet
getType
in class com.opensymphony.module.propertyset.AbstractPropertySet
key
- property key to find the type ofPropertySet
interface.com.opensymphony.module.propertyset.PropertyException
- if one of the underlying property set delegates doespublic boolean exists(String key) throws com.opensymphony.module.propertyset.PropertyException
exists
in interface com.opensymphony.module.propertyset.PropertySet
exists
in class com.opensymphony.module.propertyset.AbstractPropertySet
key
- property key to checkcom.opensymphony.module.propertyset.PropertyException
- if one of the underlying property set delegates doespublic void remove(String key) throws com.opensymphony.module.propertyset.PropertyException
remove
in interface com.opensymphony.module.propertyset.PropertySet
remove
in class com.opensymphony.module.propertyset.AbstractPropertySet
key
- key of the property to removecom.opensymphony.module.propertyset.PropertyException
- if property is first found but cannot be removed from the property setpublic boolean isSettable(String property)
isSettable
in interface com.opensymphony.module.propertyset.PropertySet
isSettable
in class com.opensymphony.module.propertyset.AbstractPropertySet
property
- the property nameprotected void setImpl(int type, String key, Object value) throws com.opensymphony.module.propertyset.PropertyException
com.opensymphony.module.propertyset.aggregate.AggregatePropertySet
and modified to perform
the set operation on the highest property set.setImpl
in class com.opensymphony.module.propertyset.AbstractPropertySet
com.opensymphony.module.propertyset.PropertyException
protected Object get(int type, String key) throws com.opensymphony.module.propertyset.PropertyException
com.opensymphony.module.propertyset.aggregate.AggregatePropertySet
and modified to perform
the get operation on the highest property set.get
in class com.opensymphony.module.propertyset.AbstractPropertySet
com.opensymphony.module.propertyset.PropertyException
Copyright © 2013 Atlassian. All Rights Reserved.