|
Oracle® Coherence Java API Reference Release 12.1.2.0.3 E26043-02 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.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 java.lang.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 java.lang.reflect.Method |
m_methodClone The "public Object clone()" method for the property type, if available. |
protected java.lang.reflect.Method |
m_methodGet The property "accessor" method. |
protected java.lang.reflect.Method |
m_methodSet The property "mutator" method. |
protected java.lang.String |
m_sName The property name. |
protected java.lang.String |
m_sNmsPrefix The namespace prefix for this property. |
protected java.lang.String |
m_sNmsUri The namespace URI for this property. |
protected java.lang.String |
m_sXml The XML element name used to store this property. |
protected static java.lang.Class[] |
NOPARAMS Parameters for finding no-parameter methods. |
Constructor Summary | |
---|---|
protected |
PropertyAdapter(XmlBean.BeanInfo infoBean, java.lang.Class clzType, java.lang.String sName, java.lang.String sXml, XmlElement xml) Construct a PropertyAdapter. |
Method Summary | |
---|---|
java.lang.Object |
clone(java.lang.Object o) Make a clone of the passed object. |
boolean |
equalsValue(java.lang.Object o1, java.lang.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. |
java.lang.Object |
fromUri(java.lang.String sUri) Deserialize an object from a URI element. |
java.lang.Object |
fromXml(XmlElement xml) Deserialize an object from an XML element. |
java.lang.Object |
get(XmlBean bean) Extract the property value from the passed bean reference. |
java.lang.reflect.Method |
getAccessor() Obtain the Method object that is used to call the property accessor. |
XmlBean.BeanInfo |
getBeanInfo() Obtain the containing BeanInfo object. |
java.lang.reflect.Method |
getCloner() Obtain the Method object that is used to deep-clone the property value. |
java.util.Iterator |
getElements(XmlElement xml) Get an iterator of child elements of the specified XmlElement that represent values for a property represented by this adapter. |
java.lang.String |
getLocalXmlName() Determine the "local" XML element name that will be used to hold the property value. |
java.lang.reflect.Method |
getMutator() Obtain the Method object that is used to call the property mutator. |
java.lang.String |
getName() Obtain the name of the property that this PropertyAdapter handles. |
java.lang.String |
getNamespacePrefix() Determine the default namespace prefix for the property. |
java.lang.String |
getNamespaceUri() Determine the namespace URI for the property. |
java.lang.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). |
java.lang.String |
getXmlName() Return the XML element name used to generate an XML. |
int |
hash(java.lang.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(java.lang.Object o) Determine if the specified value is empty. |
java.lang.Object |
readExternal(java.io.DataInput in) Read a value from the passed DataInput object. |
java.lang.Object |
readXml(XmlElement xml) Deserialize an object from XML. |
void |
set(XmlBean bean, java.lang.Object o) Store the property value in the passed bean. |
void |
setNamespacePrefix(java.lang.String sPrefix) Set the default Namespace prefix for this property. |
java.lang.String |
toString() Debugging support. |
java.lang.String |
toUri(java.lang.Object o) Serialize an object into a URI element. |
XmlElement |
toXml(java.lang.Object o) Serialize an object into an XML element. |
void |
writeExternal(java.io.DataOutput out, java.lang.Object o) Write the specified data to the passed DataOutput object. |
void |
writeXml(XmlElement xml, java.lang.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, rotateLeft, rotateLeft, rotateLeft, rotateRight, rotateRight, rotateRight, toBitString, toBitString, toBitString |
Field Detail |
---|
protected static final java.lang.Class[] NOPARAMS
protected XmlBean.BeanInfo m_infoBean
protected java.lang.String m_sName
protected java.lang.String m_sXml
protected boolean m_fAttribute
protected java.lang.Class m_clzType
protected java.lang.reflect.Method m_methodGet
protected java.lang.reflect.Method m_methodSet
protected java.lang.reflect.Method m_methodClone
protected java.lang.String m_sNmsUri
protected java.lang.String m_sNmsPrefix
Constructor Detail |
---|
protected PropertyAdapter(XmlBean.BeanInfo infoBean, java.lang.Class clzType, java.lang.String sName, java.lang.String sXml, XmlElement xml)
Note: This constructor may narrow the specified property type to match the declared property accessor return type; therefore, subclasses should not assume that the specified property type will be equal to that returned by the 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 java.lang.String getName()
public java.lang.String getLocalXmlName()
public java.lang.String getXmlName()
public boolean isElementMatch(XmlElement xml)
public XmlElement findElement(XmlElement xml)
xml
- the parent XmlElementpublic java.util.Iterator getElements(XmlElement xml)
xml
- the parent XmlElementpublic XmlValue findAttribute(XmlElement xml)
xml
- the parent XmlElementpublic java.lang.String getNamespaceUri()
public java.lang.String getNamespacePrefix()
public void setNamespacePrefix(java.lang.String sPrefix)
sPrefix
- the new default namespace for this propertypublic java.lang.Class getType()
public java.lang.reflect.Method getAccessor()
public java.lang.reflect.Method getMutator()
public java.lang.reflect.Method getCloner()
public boolean isAnonymous()
public boolean isAttribute()
public abstract boolean isCloneRequired()
public java.lang.Object get(XmlBean bean)
bean
- the XML bean object to obtain the property value frompublic boolean isEmpty(java.lang.Object o)
o
- the valuepublic void set(XmlBean bean, java.lang.Object o)
bean
- the XML bean object to store the property value intoo
- the property valuepublic int hash(java.lang.Object o)
o
- the object to compute a hash code forpublic boolean equalsValue(java.lang.Object o1, java.lang.Object o2)
o1
- the first objecto2
- the second objectpublic java.lang.Object clone(java.lang.Object o)
o
- the object to clonepublic java.lang.Object fromXml(XmlElement xml)
xml
- the XML element to deserialize fromjava.lang.UnsupportedOperationException
- if the property cannot be read from a single XML elementpublic XmlElement toXml(java.lang.Object o)
o
- the object to serializejava.lang.UnsupportedOperationException
- if the property cannot be written to a single XML elementpublic java.lang.Object readXml(XmlElement xml)
xml
- the XML element containing the XML elements to deserialize frompublic void writeXml(XmlElement xml, java.lang.Object o)
xml
- the XML element containing the XML elements to serialize too
- the object to serialize (may be null)public java.lang.Object fromUri(java.lang.String sUri)
sUri
- the URI element to deserialize fromjava.lang.UnsupportedOperationException
- if the property cannot be read from a URI elementpublic java.lang.String toUri(java.lang.Object o)
o
- the object to serializejava.lang.UnsupportedOperationException
- if the property cannot be written to a URI elementpublic java.lang.Object readExternal(java.io.DataInput in) throws java.io.IOException
in
- the DataInput stream to read property data fromjava.io.IOException
- if an I/O exception occurspublic void writeExternal(java.io.DataOutput out, java.lang.Object o) throws java.io.IOException
out
- the DataOutput stream to write too
- the data to write to the DataOutput; never nulljava.io.IOException
- if an I/O exception occurspublic java.lang.String toString()
|
Oracle® Coherence Java API Reference Release 12.1.2.0.3 E26043-02 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |