public abstract class PropertyAdapter extends ExternalizableHelper implements Serializable
<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>
ExternalizableHelper.DecoratedMultiBufferReadBuffer, ExternalizableHelper.DefaultObjectStreamFactory, ExternalizableHelper.FormatAwareCompressor, ExternalizableHelper.IntDecoratedObject, ExternalizableHelper.Shielded, ExternalizableHelper.ShieldedDataOutputStream, ExternalizableHelper.ShieldedInputStream, ExternalizableHelper.ShieldedObjectOutputStream, ExternalizableHelper.ShieldedOutputStream, ExternalizableHelper.SimpleXmlBeanClassCache, ExternalizableHelper.Stats, ExternalizableHelper.XmlBeanClassCache
Base.LoggingWriter, Base.StackFrame
Modifier and Type | Field and Description |
---|---|
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.
|
CONVERTER_FROM_BINARY, CONVERTER_STRIP_INTDECO, CONVERTER_TO_BINARY, DECO_APP_1, DECO_APP_2, DECO_APP_3, DECO_CUSTOM, DECO_EXPIRY, DECO_ID_MAX, DECO_ID_MIN, DECO_JCACHE, DECO_JCACHE_SYNTHETIC, DECO_MEMCACHED, DECO_PUSHREP, DECO_QUEUE_METADATA, DECO_RSVD_1, DECO_RSVD_2, DECO_STORE, DECO_TX, DECO_VALUE, DECO_WLS, EMPTY_BINARY_ARRAY, FMT_B_ARRAY, FMT_BIN_DECO, FMT_BIN_EXT_DECO, FMT_BINARY, FMT_BOOLEAN, FMT_BYTE, FMT_DECIMAL, FMT_DOUBLE, FMT_EXT, FMT_FLOAT, FMT_IDO, FMT_INT, FMT_INTEGER, FMT_LONG, FMT_NONE, FMT_NULL, FMT_OBJ_EXT, FMT_OBJ_SER, FMT_OPT, FMT_OPT_DOUBLE, FMT_OPT_INT, FMT_OPT_LONG, FMT_SHORT, FMT_STRING, FMT_UNKNOWN, FMT_XML_BEAN, FMT_XML_SER, FORCE_RESOLVING_STREAMS, MAX_DECO_HEADER_BYTES, PROPERTY_CONFIG, s_streamfactory, TRINT_DOMAIN_SPAN, TRINT_MAX_VALUE, TRINT_MAX_VARIANCE, USE_POF_STREAMS, USE_XMLBEAN_CLASS_CACHE, XMLBEAN_CLASS_CACHE
Modifier | Constructor and Description |
---|---|
protected |
PropertyAdapter(XmlBean.BeanInfo infoBean,
Class clzType,
String sName,
String sXml,
XmlElement xml)
Construct a PropertyAdapter.
|
Modifier and Type | Method and Description |
---|---|
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.
|
asBinary, calculatePackedLength, calculatePackedLength, checkObjectInputFilter, convertUTF, decodeExpiry, decorate, decorate, decorate, decorate, decorate, decorateBinary, encodeExpiry, ensureSerializer, extractIntDecoration, fromBinary, fromBinary, fromBinary, fromBinary, fromBinary, fromBinary, fromByteArray, fromByteArray, getClass, getDecoration, getDecoration, getDecorations, getDeltaCompressor, getInputStream, getNewObjectInput, getObjectInput, getObjectOutput, getObjectStreamFactory, getOutputStream, getShieldedOutputStream, getStreamFormat, getUndecorated, getUndecorated, isDecorated, isDecorated, isIntDecorated, isIntDecorated, isResolving, isSerializable, isSerializerCompatible, isVersionCompatible, isVersionCompatible, loadClass, loadResource, main, makeTrint, readBigDecimal, readBigInteger, readBooleanArray, readByteArray, readCollection, readDate, readDoubleArray, readExternalizableLite, readExternalizableLite, readFloatArray, readInt, readInt, readIntArray2d, readLong, readLong, readMap, readMap, readObject, readObject, readSafeUTF, readSafeUTF, readSerializable, readSerializable, readStringArray, readTime, readTimestamp, readTrint, readUnsignedTrint, readUTF, readXmlBean, readXmlSerializable, readXmlSerializable, realize, removeIntDecoration, removeIntDecoration, replace, reportIncompatibleSerializers, setObjectStreamFactory, toBinary, toBinary, toByteArray, toByteArray, toByteArray, toLiteBinary, toLong, undecorate, undecorate, validateBufferSize, writeBigDecimal, writeBigInteger, writeBooleanArray, writeByteArray, writeCollection, writeDate, writeDoubleArray, writeExternalizableLite, writeFloatArray, writeInt, writeInt, writeIntArray2d, writeLong, writeLong, writeMap, writeObject, writeSafeUTF, writeSafeUTF, writeSerializable, writeStringArray, writeTime, writeTimestamp, writeTrint, writeTrint, writeUTF, writeXmlBean, writeXmlSerializable
countBits, countBits, countBits, indexOfLSB, indexOfLSB, indexOfLSB, indexOfMSB, indexOfMSB, indexOfMSB, rotateLeft, rotateLeft, rotateLeft, rotateRight, rotateRight, rotateRight, toBitString, toBitString, toBitString, toBytes, toBytes, toBytes, toBytes, toInt, toInt, toLong
azzert, azzert, azzert, azzertFailed, breakLines, breakLines, capitalize, checkNotEmpty, checkNotNull, checkRange, computeSafeWaitTime, decimalValue, dup, dup, ensureBigDecimal, ensureClassLoader, ensureRuntimeException, ensureRuntimeException, equals, equalsDeep, err, err, err, err, err, escape, formatDateTime, getCallerStackFrame, getCommonMonitor, getCommonMonitor, getCommonMonitor, getContextClassLoader, getContextClassLoader, getDeepMessage, getErr, getLastSafeTimeMillis, getLog, getMaxDecDigits, getMaxHexDigits, getOriginalException, getOut, getProcessRandom, getRandom, getRandomBinary, getRandomBinary, getRandomString, getSafeTimeMillis, getStackFrame, getStackFrames, getStackTrace, getStackTrace, getThreadFactory, getTimeZone, getUpTimeMillis, hashCode, hexValue, indentString, indentString, isDecimal, isHex, isLogEcho, isOctal, log, log, log, log, log, makeInteger, makeLong, makeThread, mod, mod, octalValue, out, out, out, out, out, pad, parseBandwidth, parseBandwidth, parseDelimitedString, parseHex, parseHex, parseMemorySize, parseMemorySize, parsePercentage, parseTime, parseTime, parseTimeNanos, parseTimeNanos, printStackTrace, randomize, randomize, randomize, randomize, read, read, read, read, read, read, read, replace, setErr, setLog, setLogEcho, setOut, sleep, toBandwidthString, toBandwidthString, toCharEscape, toCrc, toCrc, toCrc, toCrc, toCrc, toDecString, toDelimitedString, toDelimitedString, toDelimitedString, toDelimitedString, toHex, toHex, toHexDump, toHexEscape, toHexEscape, toHexEscape, toHexEscape, toHexString, toMemorySizeString, toMemorySizeString, toQuotedCharEscape, toQuotedStringEscape, toSqlString, toString, toString, toStringEscape, toUnicodeEscape, trace, trace, trace, trace, trace, trace, trace, trace, trace, truncateString, truncateString, wait
protected static final 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
protected PropertyAdapter(XmlBean.BeanInfo infoBean, Class clzType, String sName, 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 informationpublic XmlBean.BeanInfo getBeanInfo()
public String getName()
public String getLocalXmlName()
public String getXmlName()
public boolean isElementMatch(XmlElement xml)
xml
- the XML elementpublic XmlElement findElement(XmlElement xml)
xml
- the parent XmlElementpublic Iterator getElements(XmlElement xml)
xml
- the parent XmlElementpublic XmlValue findAttribute(XmlElement xml)
xml
- the parent XmlElementpublic 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 frompublic boolean isEmpty(Object o)
o
- the valuepublic 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 forpublic boolean equalsValue(Object o1, Object o2)
o1
- the first objecto2
- the second objectpublic Object clone(Object o)
o
- the object to clonepublic Object fromXml(XmlElement xml)
xml
- the XML element to deserialize fromUnsupportedOperationException
- if the property cannot be
read from a single XML elementpublic XmlElement toXml(Object o)
o
- the object to serializeUnsupportedOperationException
- 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
frompublic 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 fromUnsupportedOperationException
- if the property cannot be
read from a URI elementpublic String toUri(Object o)
o
- the object to serializeUnsupportedOperationException
- if the property cannot be
written to a URI elementpublic Object readExternal(DataInput in) throws IOException
in
- the DataInput stream to read property data fromIOException
- 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 nullIOException
- if an I/O exception occurs