Package net.anotheria.anodoc.data
Class Property
- java.lang.Object
-
- net.anotheria.anodoc.data.DataHolder
-
- net.anotheria.anodoc.data.Property
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,IBasicStoreableObject,IPlainDataObject
- Direct Known Subclasses:
BooleanProperty,DoubleProperty,FloatProperty,IntProperty,ListProperty,LongProperty,StringProperty
public abstract class Property extends DataHolder implements IPlainDataObject, java.lang.Cloneable
This class represents a single data entry which can be stored. It is of a plain kind (can't contain any subproperties, except the ListProperty).- Since:
- 1.0
- Version:
- $Id: $Id
- Author:
- lro
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()clone.PropertycloneAs(java.lang.String newName)Creates a copy of this property with a new name.protected abstract java.lang.ObjectcloneValue()cloneValue.booleanequals(java.lang.Object o)protected java.lang.StringgetName()getName.abstract PropertyTypegetPropertyType()getPropertyType.java.lang.StringgetStorageId()Since the can't be two equally named properties in a Document, the storageId of a Property is its name.java.lang.ObjectgetValue()Getter for the fieldvalue.voidsetValue(java.lang.Object o)Sets the value of this Property.java.lang.StringtoString()net.anotheria.util.xml.XMLNodetoXMLNode()Creates an xml node for export.-
Methods inherited from class net.anotheria.anodoc.data.DataHolder
getId, getSizeInBytes, hashCode, setId
-
-
-
-
Constructor Detail
-
Property
protected Property(java.lang.String name)
Creates new Property without a value (null).- Parameters:
name- aStringobject.
-
Property
protected Property(java.lang.String name, java.lang.Object aValue)Creates a new Property with a given name and given value.- Parameters:
name- aStringobject.aValue- aObjectobject.
-
-
Method Detail
-
getValue
public java.lang.Object getValue()
Getter for the field
value.- Returns:
- the value of this property.
-
setValue
public void setValue(java.lang.Object o)
Sets the value of this Property.- Parameters:
o- object to set
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getStorageId
public java.lang.String getStorageId()
Since the can't be two equally named properties in a Document, the storageId of a Property is its name.- Specified by:
getStorageIdin interfaceIBasicStoreableObject- Returns:
- a
Stringobject. - See Also:
IBasicStoreableObject.getStorageId()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
getName
protected java.lang.String getName()
getName.
- Returns:
- the name of the property
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionclone.
- Overrides:
clonein classDataHolder- Returns:
- a
Objectobject. - Throws:
java.lang.CloneNotSupportedException- if any.
-
cloneAs
public Property cloneAs(java.lang.String newName) throws java.lang.CloneNotSupportedException
Creates a copy of this property with a new name.- Parameters:
newName- aStringobject.- Returns:
- created property with new name
- Throws:
java.lang.CloneNotSupportedException- if any.
-
cloneValue
protected abstract java.lang.Object cloneValue() throws java.lang.CloneNotSupportedExceptioncloneValue.
- Returns:
- a
Objectobject. - Throws:
java.lang.CloneNotSupportedException- if any.
-
toXMLNode
public net.anotheria.util.xml.XMLNode toXMLNode()
Creates an xml node for export.- Overrides:
toXMLNodein classDataHolder- Returns:
- new XMLNode object
-
getPropertyType
public abstract PropertyType getPropertyType()
getPropertyType.
- Returns:
- a
PropertyTypeobject.
-
-