|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.tangosol.util.Base
com.tangosol.util.BitHelper
com.tangosol.util.ExternalizableHelper
com.tangosol.run.xml.PropertyAdapter
public abstract class PropertyAdapter
The PropertyAdapter is the base class for handling the operations that can occur on any property.
<property>
<name>People</name>
<xml-name>people</xml-name> <!-- optional, empty name indicates anonymous element -->
<adapter>...</adapter> <!-- optional -->
<type>...</type> <!-- defaults via reflection -->
<class>...</class> <!-- defaults to <type> -->
<property>
Field Summary | |
---|---|
protected Class |
m_clzType
The type of the property. |
protected boolean |
m_fAttribute
True if the property is stored in an attribute instead of an XML element. |
protected XmlBean.BeanInfo |
m_infoBean
The BeanInfo object that contains this PropertyAdapter. |
protected Method |
m_methodClone
The "public Object clone()" method for the property type, if available. |
protected Method |
m_methodGet
The property "accessor" method. |
protected Method |
m_methodSet
The property "mutator" method. |
protected String |
m_sName
The property name. |
protected String |
m_sNmsPrefix
The namespace prefix for this property. |
protected String |
m_sNmsUri
The namespace URI for this property. |
protected String |
m_sXml
The XML element name used to store this property. |
protected static Class[] |
NOPARAMS
Parameters for finding no-parameter methods. |
Constructor Summary | |
---|---|
protected |
PropertyAdapter(XmlBean.BeanInfo infoBean,
Class clzType,
String sName,
String sXml,
XmlElement xml)
Construct a PropertyAdapter. |
Method Summary | |
---|---|
Object |
clone(Object o)
Make a clone of the passed object. |
boolean |
equalsValue(Object o1,
Object o2)
Compare the two passed objects for equality. |
XmlValue |
findAttribute(XmlElement xml)
Find an attribute of the specified XmlElement that represents a value for a property represented by this adapter. |
XmlElement |
findElement(XmlElement xml)
Find a child element of the specified XmlElement that represents a value for a property represented by this adapter. |
Object |
fromUri(String sUri)
Deserialize an object from a URI element. |
Object |
fromXml(XmlElement xml)
Deserialize an object from an XML element. |
Object |
get(XmlBean bean)
Extract the property value from the passed bean reference. |
Method |
getAccessor()
Obtain the Method object that is used to call the property accessor. |
XmlBean.BeanInfo |
getBeanInfo()
Obtain the containing BeanInfo object. |
Method |
getCloner()
Obtain the Method object that is used to deep-clone the property value. |
Iterator |
getElements(XmlElement xml)
Get an iterator of child elements of the specified XmlElement that represent values for a property represented by this adapter. |
String |
getLocalXmlName()
Determine the "local" XML element name that will be used to hold the property value. |
Method |
getMutator()
Obtain the Method object that is used to call the property mutator. |
String |
getName()
Obtain the name of the property that this PropertyAdapter handles. |
String |
getNamespacePrefix()
Determine the default namespace prefix for the property. |
String |
getNamespaceUri()
Determine the namespace URI for the property. |
Class |
getType()
Obtain the type of the property (the class of the object declared as being returned by the accessor and passed to the mutator). |
String |
getXmlName()
Return the XML element name used to generate an XML. |
int |
hash(Object o)
Compute a hash code for the passed object. |
boolean |
isAnonymous()
Determine if this property does not have a designated element name. |
boolean |
isAttribute()
Determine if the property is stored in an XML attribute instead of an XML element. |
abstract boolean |
isCloneRequired()
Determine if the property value must be deep-cloned. |
boolean |
isElementMatch(XmlElement xml)
Check whether or not the passed element matches to the property's local name and Namespace URI. |
boolean |
isEmpty(Object o)
Determine if the specified value is empty. |
Object |
readExternal(DataInput in)
Read a value from the passed DataInput object. |
Object |
readXml(XmlElement xml)
Deserialize an object from XML. |
void |
set(XmlBean bean,
Object o)
Store the property value in the passed bean. |
void |
setNamespacePrefix(String sPrefix)
Set the default Namespace prefix for this property. |
String |
toString()
Debugging support. |
String |
toUri(Object o)
Serialize an object into a URI element. |
XmlElement |
toXml(Object o)
Serialize an object into an XML element. |
void |
writeExternal(DataOutput out,
Object o)
Write the specified data to the passed DataOutput object. |
void |
writeXml(XmlElement xml,
Object o)
Serialize an object into an XML element. |
Methods inherited from class com.tangosol.util.BitHelper |
---|
countBits, countBits, countBits, indexOfLSB, indexOfLSB, indexOfLSB, indexOfMSB, indexOfMSB, indexOfMSB, toBitString, toBitString, toBitString |
Field Detail |
---|
protected static Class[] NOPARAMS
protected XmlBean.BeanInfo m_infoBean
protected String m_sName
protected String m_sXml
protected boolean m_fAttribute
protected Class m_clzType
protected Method m_methodGet
protected Method m_methodSet
protected Method m_methodClone
protected String m_sNmsUri
protected String m_sNmsPrefix
Constructor Detail |
---|
protected PropertyAdapter(XmlBean.BeanInfo infoBean, Class clzType, String sName, String sXml, XmlElement xml)
getType()
method.
infoBean
- BeanInfo for a bean containing this propertyclzType
- the type of the propertysName
- the property namesXml
- the XML tag namexml
- additional XML informationMethod Detail |
---|
public XmlBean.BeanInfo getBeanInfo()
public String getName()
public String getLocalXmlName()
public String getXmlName()
public boolean isElementMatch(XmlElement xml)
public XmlElement findElement(XmlElement xml)
xml
- the parent XmlElement
public Iterator getElements(XmlElement xml)
xml
- the parent XmlElement
public XmlValue findAttribute(XmlElement xml)
xml
- the parent XmlElement
public String getNamespaceUri()
public String getNamespacePrefix()
public void setNamespacePrefix(String sPrefix)
sPrefix
- the new default namespace for this propertypublic Class getType()
public Method getAccessor()
public Method getMutator()
public Method getCloner()
public boolean isAnonymous()
public boolean isAttribute()
public abstract boolean isCloneRequired()
public Object get(XmlBean bean)
bean
- the XML bean object to obtain the property value from
public boolean isEmpty(Object o)
o
- the value
public void set(XmlBean bean, Object o)
bean
- the XML bean object to store the property value intoo
- the property valuepublic int hash(Object o)
o
- the object to compute a hash code for
public boolean equalsValue(Object o1, Object o2)
o1
- the first objecto2
- the second object
public Object clone(Object o)
o
- the object to clone
public Object fromXml(XmlElement xml)
xml
- the XML element to deserialize from
UnsupportedOperationException
- if the property cannot be
read from a single XML elementpublic XmlElement toXml(Object o)
o
- the object to serialize
UnsupportedOperationException
- if the property cannot be
written to a single XML elementpublic Object readXml(XmlElement xml)
xml
- the XML element containing the XML elements to deserialize
from
public void writeXml(XmlElement xml, Object o)
xml
- the XML element containing the XML elements to serialize too
- the object to serialize (may be null)public Object fromUri(String sUri)
sUri
- the URI element to deserialize from
UnsupportedOperationException
- if the property cannot be
read from a URI elementpublic String toUri(Object o)
o
- the object to serialize
UnsupportedOperationException
- if the property cannot be
written to a URI elementpublic Object readExternal(DataInput in) throws IOException
in
- the DataInput stream to read property data from
IOException
- if an I/O exception occurspublic void writeExternal(DataOutput out, Object o) throws IOException
out
- the DataOutput stream to write too
- the data to write to the DataOutput; never null
IOException
- if an I/O exception occurspublic String toString()
|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |