|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rhq.core.domain.configuration.Property
org.rhq.core.domain.configuration.PropertyMap
public class PropertyMap
Holds a map of child properties. This can hold any number of properties, including additional lists
and maps of properties (which means you can have N-levels of hierarchical data).
This map will store the properties keyed on property name.
Caution must be used when accessing this object. This class is not thread safe and, for entity persistence, the
child properties must have their Property.getParentMap() field set. This is done for you when using the
put(Property) method.
| Constructor Summary | |
|---|---|
PropertyMap()
Creates a new unnamed and empty PropertyMap object. |
|
PropertyMap(String name)
Creates a new, empty PropertyMap object that is associated with the given name. |
|
PropertyMap(String name,
Property... startingProperties)
Creates a new PropertyMap object that is associated with the given name and has the given properties as
its initial set of child properties. |
|
| Method Summary | |
|---|---|
void |
afterUnmarshal(javax.xml.bind.Unmarshaller u,
Object parent)
This listener runs after jaxb unmarshalling and reconnects children properties to their parent maps (as we don't send them avoiding cyclic references). |
protected void |
appendToStringInternals(StringBuilder str)
Subclasses can override this to add things it wants to see in the toString. |
boolean |
equals(Object obj)
NOTE: An PropertyMap containing a null map is considered equal to a PropertyMap containing an empty map. |
Property |
get(String name)
Looks for a property with the given name in the map and returns it. |
PropertyList |
getList(String name)
Looks for a child list property with the given name in the map and returns it. |
Map<String,Property> |
getMap()
Returns the contents of this PropertyMap as a map. |
PropertyMap |
getMap(String name)
Looks for a child map property with the given name in the map and returns it. |
PropertySimple |
getSimple(String name)
Looks for a child simple property with the given name in the map and returns it. |
String |
getSimpleValue(String name,
String defaultValue)
|
int |
hashCode()
|
void |
put(Property property)
Put a child property into this map keyed on the given property's name. |
void |
readExternal(ObjectInput in)
|
void |
setMap(Map<String,Property> map)
Sets the map of child properties directly to the given map reference. |
void |
writeExternal(ObjectOutput out)
|
| Methods inherited from class org.rhq.core.domain.configuration.Property |
|---|
getConfiguration, getErrorMessage, getId, getName, getParentList, getParentMap, setConfiguration, setErrorMessage, setErrorMessageFromThrowable, setId, setName, setParentList, setParentMap, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public PropertyMap()
PropertyMap object.
public PropertyMap(@NotNull
String name)
PropertyMap object that is associated with the given name.
name - the name of the map itself
public PropertyMap(@NotNull
String name,
Property... startingProperties)
PropertyMap object that is associated with the given name and has the given properties as
its initial set of child properties. All properties found in startingProperties will have their
parent map set to this newly constructed map.
name - the name of the map itselfstartingProperties - a set of properties to be immediately added to this map| Method Detail |
|---|
@NotNull public Map<String,Property> getMap()
Warning: Caution should be used when accessing the returned map. Please see
the javadoc for this class for more information.
getMap in interface AbstractPropertyMappublic void setMap(Map<String,Property> map)
map reference. This means the actual
map object is stored internally in this object. Changes made to map will be reflected back
into this object.
Warning: Caution should be used when setting this object's internal map. Please see
the javadoc for this class for more information.
map - the new map used internally by this object
public void put(@NotNull
Property property)
parent map for the child property to make persistence work.
put in interface AbstractPropertyMapproperty - the property to add to this map.public Property get(String name)
null is returned if it is not
found.
get in interface AbstractPropertyMapname - the name of the property to return
null if it does not exist as a child to this mappublic PropertySimple getSimple(String name)
null is returned if
it is not found.
getSimple in interface AbstractPropertyMapname - the name of the child simple property to return
null if it does not exist as a child to this map
ClassCastException - if the named property is not of type PropertySimple
public String getSimpleValue(String name,
String defaultValue)
public PropertyList getList(String name)
null is returned if
it is not found.
getList in interface AbstractPropertyMapname - the name of the child list property to return
null if it does not exist as a child to this map
ClassCastException - if the named property is not of type PropertyListpublic PropertyMap getMap(String name)
null is returned if it
is not found.
getMap in interface AbstractPropertyMapname - the name of the child map property to return
null if it does not exist as a child to this map
ClassCastException - if the named property is not of type PropertyMap
public void readExternal(ObjectInput in)
throws IOException,
ClassNotFoundException
readExternal in interface ExternalizablereadExternal in class PropertyIOException
ClassNotFoundExceptionProperty.readExternal(java.io.ObjectInput)
public void writeExternal(ObjectOutput out)
throws IOException
writeExternal in interface ExternalizablewriteExternal in class PropertyIOExceptionProperty.writeExternal(java.io.ObjectOutput)public boolean equals(Object obj)
equals in class Propertypublic int hashCode()
hashCode in class Propertyprotected void appendToStringInternals(StringBuilder str)
Property
appendToStringInternals in class Propertystr - the builder to append strings to
public void afterUnmarshal(javax.xml.bind.Unmarshaller u,
Object parent)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||