|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlumis.portal.hierarquicalpropertybag.HierarquicalPropertyBag
public class HierarquicalPropertyBag
Object that represents a hierarquical property bag.
This is a property bag that contains name value pairs where name
is a string that is unique within a property bag and the value is
a Property
object.
A property bag may have a parent property bag from which it may inherit properties. Properties inherited from a parent property bag may be overridden in the child property bag.
Method Summary | |
---|---|
void |
addProperty(Property property)
Adds a local property to the property bag. |
String |
getId()
Returns the identifier of the property bag |
Collection<Property> |
getLocalProperties()
Returns all the local properties of the property bag. |
Property |
getLocalProperty(String propertyName)
Returns a single local property of the property bag. |
HierarquicalPropertyBag |
getParentPropertyBag()
Returns the parent property bag object |
Collection<Property> |
getProperties()
Returns the aggregated properties of the property bag. |
Property |
getProperty(String propertyName)
Returns a property of the property bag. |
protected Map<String,Property> |
getPropertyMap()
Internal method that returns the cumulative property map. |
boolean |
isInheritProperties()
Returns true if the property bag is inheriting properties from its parent. |
void |
removeProperty(String propertyName)
Removes the property in the property bag with the given name. |
void |
setInheritProperties(boolean inheritProperties)
Sets whether the property bag should inherit properties from its parent. |
void |
setParentPropertyBag(HierarquicalPropertyBag parentPropertyBag)
Sets the parent property bag. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public String getId()
public HierarquicalPropertyBag getParentPropertyBag()
public void setParentPropertyBag(HierarquicalPropertyBag parentPropertyBag)
parentPropertyBag
- the parent property bagpublic boolean isInheritProperties()
public void setInheritProperties(boolean inheritProperties)
inheritProperties
- boolean inheritance value.public Collection<Property> getLocalProperties()
These properties do not take into consideration the properties that may be inherited from the parent property bag. If a property bag is not inheriting properties, the getProperties() method and this method should return the same values.
public Property getLocalProperty(String propertyName) throws PortalException
Inherited properties are not returned.
propertyName
- name of the property to return.
PortalException
public Collection<Property> getProperties()
If the property bag has the inherit properties flag set and if it has a parent property bag, the properties of the parent are first called and subsequently the local properties are merged with the inherited ones. If there are properties with the same name, the local property is preserved discarding the inherited property.
public Property getProperty(String propertyName) throws PortalException
The property may be an inherited property.
propertyName
- name of the property to return
PortalException
protected Map<String,Property> getPropertyMap()
public void addProperty(Property property) throws PortalException
If the property bag already contains a local property with the same name, an PortalObjectAlreadyExistsException exception is thrown.
property
- the property to add.
PortalException
public void removeProperty(String propertyName) throws PortalException
If a property with the given name does not exist in the local properties of the property bag, a PortalObjectNotFoundException exception is thrown.
propertyName
- name of the property to remove.
PortalException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |