|
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
com.tangosol.run.xml.IterableAdapter
public abstract class IterableAdapter
An IterableAdapter is the base class for any data type that must be iterated over to serialize/deserialize, such as arrays, collections and maps.
<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> -->
<sparse>true</sparse> <!-- defaults to false -->
<empty-is-null>true</empty-is-null> <!-- defaults to false -->
<element> <!-- optional, depends on the adapter -->
<xml-name>person</xml-name> <!-- optional, nests the elements -->
</element>
<property>
Example of collection/array nested within collection tags:
<doc>
<people>
<person>...</person>
<person>...</person>
...
</people>
</doc>
Example of collection/array nested directly within the document:
<doc>
<person>...</person>
<person>...</person>
...
</doc>
Example of map nested within collection tags:
<doc>
<people>
<person>
<name>...</name>
<number>...</number>
</person>
<person>
<name>...</name>
<number>...</number>
</person>
...
</people>
</doc>
Example of map nested directly within the document:
<doc>
<person>
<name>...</name>
<number>...</number>
</person>
<person>
<name>...</name>
<number>...</number>
</person>
...
</doc>
Field Summary | |
---|---|
protected boolean |
m_fEmptyIsNull
Empty-is-null option: Empty iterable values are not stored in the serialized form of the XmlBean nor in the XML form of the XmlBean. |
protected boolean |
m_fSparse
Sparse array storage option. |
protected String |
m_sElement
Name used for each element of the array when formatted into XML. |
Fields inherited from class com.tangosol.run.xml.PropertyAdapter |
---|
m_clzType, m_fAttribute, m_infoBean, m_methodClone, m_methodGet, m_methodSet, m_sName, m_sNmsPrefix, m_sNmsUri, m_sXml, NOPARAMS |
Constructor Summary | |
---|---|
IterableAdapter(XmlBean.BeanInfo infoBean,
Class clzType,
String sName,
String sXml,
XmlElement xml)
Construct a IterableAdapter. |
Method Summary | |
---|---|
protected PropertyAdapter |
findAdapter(XmlBean.BeanInfo infoBean,
XmlElement xml)
Obtain a PropertyAdapapter for a map entry key or value |
Object |
fromXml(XmlElement xml)
Deserialize an object from an XML element. |
String |
getElementName()
|
boolean |
isCloneRequired()
Determine if the property value must be deep-cloned. |
boolean |
isEmptyIsNull()
|
boolean |
isNested()
|
boolean |
isSparse()
|
protected abstract Object |
readElements(XmlElement xml)
|
XmlElement |
toXml(Object o)
Serialize an object into an XML element. |
protected abstract void |
writeElements(XmlElement xml,
Object o)
|
Methods inherited from class com.tangosol.run.xml.PropertyAdapter |
---|
clone, equalsValue, findAttribute, findElement, fromUri, get, getAccessor, getBeanInfo, getCloner, getElements, getLocalXmlName, getMutator, getName, getNamespacePrefix, getNamespaceUri, getType, getXmlName, hash, isAnonymous, isAttribute, isElementMatch, isEmpty, readExternal, readXml, set, setNamespacePrefix, toString, toUri, writeExternal, writeXml |
Methods inherited from class com.tangosol.util.BitHelper |
---|
countBits, countBits, countBits, indexOfLSB, indexOfLSB, indexOfLSB, indexOfMSB, indexOfMSB, indexOfMSB, toBitString, toBitString, toBitString |
Field Detail |
---|
protected boolean m_fSparse
protected boolean m_fEmptyIsNull
protected String m_sElement
Constructor Detail |
---|
public IterableAdapter(XmlBean.BeanInfo infoBean, Class clzType, String sName, String sXml, XmlElement xml)
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 boolean isCloneRequired()
PropertyAdapter
isCloneRequired
in class PropertyAdapter
public boolean isSparse()
public boolean isEmptyIsNull()
public String getElementName()
public boolean isNested()
public Object fromXml(XmlElement xml)
fromXml
in class PropertyAdapter
xml
- the XML element to deserialize from
UnsupportedOperationException
- if the property cannot be
read from a single XML elementpublic XmlElement toXml(Object o)
toXml
in class PropertyAdapter
o
- the object to serialize
UnsupportedOperationException
- if the property cannot be
written to a single XML elementprotected abstract Object readElements(XmlElement xml)
xml
- the XML element containing the XML elements to deserialize
from
protected abstract void writeElements(XmlElement xml, Object o)
xml
- the XML element to which the iterable elements are writteno
- the object to serialize (not null)protected PropertyAdapter findAdapter(XmlBean.BeanInfo infoBean, XmlElement xml)
infoBean
- BeanInfo for a bean containing this propertyxml
- the information about the map entry key or value
|
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 |