public class PropertySpec extends Object implements Comparable<PropertySpec>, Serializable, PortableObject
Modifier and Type | Field and Description |
---|---|
protected Class |
m_clzPartialClass
Property class (only for partial properties).
|
protected ValueExtractor |
m_extractor
An extractor that can extract value of this property from a target
object.
|
protected PropertySet |
m_propertySet
A set of nested properties.
|
protected String |
m_sName
Property name.
|
Constructor and Description |
---|
PropertySpec()
Default constructor (necessary for deserialization).
|
PropertySpec(String sName)
Construct PropertySpec instance.
|
PropertySpec(String sName,
PropertySet propertySet)
Construct PropertySpec instance.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(PropertySpec o)
Compare this object to another.
|
boolean |
equals(Object o)
Test equality of this object with another.
|
static PropertySpec |
fromString(String sSpec)
Create a PropertySpec from its textual representation.
|
protected ValueExtractor |
getExtractor()
Return extractor for this property.
|
String |
getName()
Return the property name.
|
Class |
getPartialClass()
Return the partial class for this property.
|
PropertySet |
getPropertySet()
Return the set of nested properties.
|
Object |
getValue(Object oTarget)
Extract the value of this property from a target object.
|
int |
hashCode()
Return hash code for this object.
|
boolean |
isPartial()
Return whether this is a partial property or not.
|
void |
readExternal(PofReader reader)
Restore the contents of a user type instance by reading its state using
the specified PofReader object.
|
void |
setPartialClass(Class clzPartialClass)
Set the partial class for this property.
|
String |
toString()
Return string representation of this object.
|
void |
writeExternal(PofWriter writer)
Save the contents of a POF user type instance by writing its state using
the specified PofWriter object.
|
protected String m_sName
protected PropertySet m_propertySet
protected transient Class m_clzPartialClass
protected transient ValueExtractor m_extractor
public PropertySpec()
public PropertySpec(String sName)
sName
- property namepublic PropertySpec(String sName, PropertySet propertySet)
sName
- property namepropertySet
- a set of nested propertiespublic static PropertySpec fromString(String sSpec)
sSpec
- property specification as a stringpublic Object getValue(Object oTarget)
oTarget
- object to extract the value frompublic int compareTo(PropertySpec o)
compareTo
in interface Comparable<PropertySpec>
o
- object to compare this object withpublic void readExternal(PofReader reader) throws IOException
readExternal
in interface PortableObject
reader
- the PofReader from which to read the object's stateIOException
- if an I/O error occurspublic void writeExternal(PofWriter writer) throws IOException
writeExternal
in interface PortableObject
writer
- the PofWriter to which to write the object's stateIOException
- if an I/O error occurspublic boolean equals(Object o)
public int hashCode()
public String toString()
public String getName()
public PropertySet getPropertySet()
public boolean isPartial()
public Class getPartialClass()
public void setPartialClass(Class clzPartialClass)
clzPartialClass
- class of this propertyprotected ValueExtractor getExtractor()