org.palo.api.impl
Class Property2Impl

java.lang.Object
  extended by org.palo.api.impl.Property2Impl
All Implemented Interfaces:
NamedEntity, PaloObject, Property2, Writable

public class Property2Impl
extends java.lang.Object
implements Property2


Field Summary
 
Fields inherited from interface org.palo.api.Property2
TYPE_BOOLEAN, TYPE_NUMERIC, TYPE_STRING
 
Fields inherited from interface org.palo.api.PaloObject
TYPE_ATTRIBUTE, TYPE_NORMAL, TYPE_SYSTEM, TYPE_USER_INFO
 
Method Summary
 void addChild(Property2 child)
          Adds a new child to this property.
 boolean canBeModified()
          Returns true if this object can be modified (renamed, deleted, ...), false otherwise.
 boolean canCreateChildren()
          Returns true if this object can create child objects, false otherwise.
 void clearChildren()
          Clears all children of this property.
 int getChildCount()
          Returns the number of children of this property.
 Property2[] getChildren()
          Returns all child properties of this property.
 Property2[] getChildren(java.lang.String childId)
          Returns all child properties with the specified id.
 java.lang.String getChildValue(java.lang.String childId)
          Returns the value for the first child with the specified id or an empty string no such child exists.
 java.lang.String getId()
          Returns the unique identifier of this palo object.
 java.lang.String getName()
          Returns the name of the entity.
 Property2 getParent()
          Returns the parent of this property or null if no parent exists.
 int getType()
          Returns the type of this property.
 java.lang.String getValue()
          Returns the string representation of this property's value.
 boolean isReadOnly()
          Returns true if this property cannot be modified.
 void removeChild(Property2 child)
          Removes a given child from this property.
 void setValue(java.lang.String newValue)
          Sets the new value for this property.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addChild

public void addChild(Property2 child)
Description copied from interface: Property2
Adds a new child to this property.

Specified by:
addChild in interface Property2
Parameters:
child - the property to add to this property.

clearChildren

public void clearChildren()
Description copied from interface: Property2
Clears all children of this property.

Specified by:
clearChildren in interface Property2

getChildCount

public int getChildCount()
Description copied from interface: Property2
Returns the number of children of this property.

Specified by:
getChildCount in interface Property2
Returns:
the number of children of this property.

getChildren

public Property2[] getChildren()
Description copied from interface: Property2
Returns all child properties of this property.

Specified by:
getChildren in interface Property2
Returns:
all child properties of this property.

getParent

public Property2 getParent()
Description copied from interface: Property2
Returns the parent of this property or null if no parent exists.

Specified by:
getParent in interface Property2
Returns:
the parent of this property.

getValue

public java.lang.String getValue()
Description copied from interface: Property2
Returns the string representation of this property's value. If the type of this property is either numeric or boolean, the string representation can be parsed to a double or a boolean, respectively.

Specified by:
getValue in interface Property2
Returns:
the string representation of this property's value.

removeChild

public void removeChild(Property2 child)
Description copied from interface: Property2
Removes a given child from this property.

Specified by:
removeChild in interface Property2

setValue

public void setValue(java.lang.String newValue)
Description copied from interface: Property2
Sets the new value for this property.

Specified by:
setValue in interface Property2
Parameters:
newValue - a new value for this property.

getId

public java.lang.String getId()
Description copied from interface: PaloObject
Returns the unique identifier of this palo object.

Important note: for a correct usage please note that the returned id is only unique within the parent scope of this palo object. Furthermore in case of deletion the id is reused, i.e. if a palo object is removed its id could be given to a newly created palo object afterwards!!

Specified by:
getId in interface PaloObject
Returns:
id of the palo object.

getName

public java.lang.String getName()
Description copied from interface: NamedEntity
Returns the name of the entity.

Specified by:
getName in interface NamedEntity
Returns:
the name of the entity.

isReadOnly

public boolean isReadOnly()
Description copied from interface: Property2
Returns true if this property cannot be modified.

Specified by:
isReadOnly in interface Property2
Returns:
true if this property cannot be modified, false otherwise.

getChildValue

public java.lang.String getChildValue(java.lang.String childId)
Description copied from interface: Property2
Returns the value for the first child with the specified id or an empty string no such child exists.

Specified by:
getChildValue in interface Property2
Parameters:
childId - the id of the child property.
Returns:
the value of the first child property with the specified id or an empty string if no child with this id exists.

getChildren

public Property2[] getChildren(java.lang.String childId)
Description copied from interface: Property2
Returns all child properties with the specified id.

Specified by:
getChildren in interface Property2
Parameters:
childId - the id of the child properties which should be returned.
Returns:
all child properties with the given id.

canBeModified

public boolean canBeModified()
Description copied from interface: Writable
Returns true if this object can be modified (renamed, deleted, ...), false otherwise.

Specified by:
canBeModified in interface Writable
Returns:
true if this object can be modified, false otherwise.

canCreateChildren

public boolean canCreateChildren()
Description copied from interface: Writable
Returns true if this object can create child objects, false otherwise.

Specified by:
canCreateChildren in interface Writable
Returns:
true if this object can create child objects, false otherwise.

getType

public int getType()
Description copied from interface: Property2
Returns the type of this property.

Specified by:
getType in interface PaloObject
Specified by:
getType in interface Property2
Returns:
the type of this property as defined in the constants in this interface.