|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.rhq.core.domain.configuration.Property
public abstract class Property
The abstract base class for all Configuration
value property types. A property is associated with a specific
getName()
and can contain one or more values. Since a Configuration
represents a hierarchical set of
data, properties can have a parent. For example, if a property is a member of a PropertyList
, it will have a
parent list
.
There are three different types (i.e. subclasses) of properties:
These subclasses are mapped into a single table so referential integrity is easy to maintain.
Maps may only have one value for a given key, while lists may have many and follow Bag rules.
Note that each property can have an optional error message associated with it. This is used typically when the
property is stored in a configuration that is inside a AbstractResourceConfigurationUpdate
object. If a
property failed to get set, this property's error message can be used to indicate why it failed (e.g. the property's
value was out of range or some other validation rule was not followed).
Constructor Summary | |
---|---|
Property()
|
Method Summary | |
---|---|
protected void |
appendToStringInternals(StringBuilder str)
Subclasses can override this to add things it wants to see in the toString. |
boolean |
equals(Object obj)
|
Configuration |
getConfiguration()
Returns the Configuration object where this property can be found. |
String |
getErrorMessage()
If the property value has been detected to be invalid for some reason, this is an error message that describes the error. |
int |
getId()
|
String |
getName()
Returns the name of this property. |
PropertyList |
getParentList()
Returns the parent of this property, assuming this property is a child of a PropertyList . |
PropertyMap |
getParentMap()
Returns the parent of this property, assuming this property is a child of a PropertyMap . |
int |
hashCode()
|
void |
readExternal(ObjectInput in)
|
void |
setConfiguration(Configuration configuration)
Sets the Configuration object where this property can be found. |
void |
setErrorMessage(String errorMessage)
|
void |
setErrorMessageFromThrowable(Throwable t)
Convienence method that sets the error message to the given throwable's stack trace dump. |
void |
setId(int id)
|
void |
setName(String name)
Defines the name that this property will be associated with. |
void |
setParentList(PropertyList parentList)
Sets the parent of this property, which will assume this property is a member of a list . |
void |
setParentMap(PropertyMap parentMap)
Sets the parent of this property, which will assume this property is a member of a map . |
String |
toString()
|
void |
writeExternal(ObjectOutput out)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Property()
Method Detail |
---|
public int getId()
public void setId(int id)
@NotNull public String getName()
public void setName(@NotNull String name)
name
- the name that this property will be associated withpublic PropertyList getParentList()
PropertyList
.
null
will be returned if this property is not a child of any list.
Note that direct children of the Configuration
object will return null
.
null
public void setParentList(PropertyList parentList)
list
. Set
this to null
if this property is not a child of any list.
parentList
- the parent of this property or null
public PropertyMap getParentMap()
PropertyMap
.
null
will be returned if this property is not a child of any map.
Note that direct children of the Configuration
object will return null
.
null
public void setParentMap(PropertyMap parentMap)
map
. Set
this to null
if this property is not a child of any map.
parentMap
- the parent of this property or null
public Configuration getConfiguration()
Configuration
object where this property can be found. This will be null
if this
property is a child of a PropertyList
or PropertyMap
and not a direct child of the
Configuration
itself.
Configuration
, or null
public void setConfiguration(Configuration configuration)
Configuration
object where this property can be found. Set this to null
if this
property is a child of a PropertyList
or PropertyMap
and not a direct child of the
Configuration
itself.
configuration
- this property's associated Configuration
, or null
@Nullable public String getErrorMessage()
null
if either the property is valid or it is not known if the property is
valid or not. Depending on the context of where this property instance is will dictate the semantics of a
null
error message (see AbstractResourceConfigurationUpdate
).
public void setErrorMessage(@Nullable String errorMessage)
public void setErrorMessageFromThrowable(Throwable t)
null
, the error message will be set to null
as if passing null
to
setErrorMessage(String)
.
t
- throwable whose message and stack trace will make up the error message (may be null
)public boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
Externalizable.writeExternal(java.io.ObjectOutput)
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
Externalizable.readExternal(java.io.ObjectInput)
public String toString()
toString
in class Object
protected void appendToStringInternals(StringBuilder str)
str
- the builder to append strings to
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |