站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 jaxrpc API Documentation 英文版文档

BeanDeserializer (JAXRPC API) - JBoss 4.0.1 sp1 jaxrpc API Documentation 英文版文档


org.apache.axis.encoding.ser
Class BeanDeserializer

java.lang.Object
  extended byorg.xml.sax.helpers.DefaultHandler
      extended byorg.apache.axis.message.SOAPHandler
          extended byorg.apache.axis.encoding.DeserializerImpl
              extended byorg.apache.axis.encoding.ser.BeanDeserializer
All Implemented Interfaces:
Callback, ContentHandler, javax.xml.rpc.encoding.Deserializer, Deserializer, DTDHandler, EntityResolver, ErrorHandler, Serializable

public class BeanDeserializer
extends DeserializerImpl
implements Serializable

General purpose deserializer for an arbitrary java bean.

Author:
Sam Ruby , Rich Scheuerle , Tom Jordahl
See Also:
Serialized Form

Field Summary
protected  SimpleDeserializer cacheStringDSer
           
protected  javax.xml.namespace.QName cacheXMLType
           
protected  int collectionIndex
           
protected  DeferedBeanConstruction deferedConstruction
           
protected  String lastFieldName
           
protected  javax.xml.namespace.QName prevQName
           
protected  Map propertyMap
           
protected  TypeDesc typeDesc
          Type metadata about this class for XML deserialization
 
Fields inherited from class org.apache.axis.encoding.DeserializerImpl
defaultType, id, isEnded, isHref, isNil, targets, value
 
Fields inherited from class org.apache.axis.message.SOAPHandler
myElement
 
Constructor Summary
BeanDeserializer(Class javaType, javax.xml.namespace.QName xmlType)
           
BeanDeserializer(Class javaType, javax.xml.namespace.QName xmlType, TypeDesc typeDesc)
           
BeanDeserializer(Class javaType, javax.xml.namespace.QName xmlType, TypeDesc typeDesc, Map propertyMap)
           
 
Method Summary
 void characters(char[] p1, int p2, int p3)
          This will assign text content to the bean property that is an element with the asContent flag set to true.
 BeanPropertyDescriptor getAnyPropertyDesc()
          Get a BeanPropertyDescriptor which indicates where we should put extensibility elements (i.e.
protected  Deserializer getDeserializer(javax.xml.namespace.QName xmlType, Class javaType, String href, DeserializationContext context)
          Get the Deserializer for the attribute or child element.
 void onEndElement(String namespace, String localName, DeserializationContext context)
          Check that we have a valid bean instance
 SOAPHandler onStartChild(String namespace, String localName, String prefix, Attributes attributes, DeserializationContext context)
          Deserializer interface called on each child element encountered in the XML stream.
 void onStartElement(String namespace, String localName, String prefix, Attributes attributes, DeserializationContext context)
          Set the bean properties that correspond to element attributes.
 
Methods inherited from class org.apache.axis.encoding.DeserializerImpl
addChildDeserializer, componentsReady, endElement, getDefaultType, getMechanismType, getValue, getValue, getValueTargets, moveValueTargets, registerValueTarget, removeValueTargets, setChildValue, setDefaultType, setValue, setValue, startElement, valueComplete
 
Methods inherited from class org.apache.axis.message.SOAPHandler
makeNewElement, onEndChild
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

propertyMap

protected Map propertyMap

prevQName

protected javax.xml.namespace.QName prevQName

typeDesc

protected TypeDesc typeDesc
Type metadata about this class for XML deserialization


collectionIndex

protected int collectionIndex

cacheStringDSer

protected SimpleDeserializer cacheStringDSer

cacheXMLType

protected javax.xml.namespace.QName cacheXMLType

lastFieldName

protected String lastFieldName

deferedConstruction

protected DeferedBeanConstruction deferedConstruction
Constructor Detail

BeanDeserializer

public BeanDeserializer(Class javaType,
                        javax.xml.namespace.QName xmlType)

BeanDeserializer

public BeanDeserializer(Class javaType,
                        javax.xml.namespace.QName xmlType,
                        TypeDesc typeDesc)

BeanDeserializer

public BeanDeserializer(Class javaType,
                        javax.xml.namespace.QName xmlType,
                        TypeDesc typeDesc,
                        Map propertyMap)
Method Detail

onStartElement

public void onStartElement(String namespace,
                           String localName,
                           String prefix,
                           Attributes attributes,
                           DeserializationContext context)
                    throws SAXException
Set the bean properties that correspond to element attributes.

This method is invoked after startElement when the element requires deserialization (i.e. the element is not an href and the value is not nil.)

Specified by:
onStartElement in interface Deserializer
Overrides:
onStartElement in class DeserializerImpl
Parameters:
namespace - is the namespace of the element
localName - is the name of the element
prefix - is the prefix of the element
attributes - are the attributes on the element...used to get the type
context - is the DeserializationContext
Throws:
SAXException

onStartChild

public SOAPHandler onStartChild(String namespace,
                                String localName,
                                String prefix,
                                Attributes attributes,
                                DeserializationContext context)
                         throws SAXException
Deserializer interface called on each child element encountered in the XML stream.

Specified by:
onStartChild in interface Deserializer
Overrides:
onStartChild in class DeserializerImpl
Parameters:
namespace - is the namespace of the child element
localName - is the local name of the child element
prefix - is the prefix used on the name of the child element
attributes - are the attributes of the child element
context - is the deserialization context.
Returns:
is a Deserializer to use to deserialize a child (must be a derived class of SOAPHandler) or null if no deserialization should be performed.
Throws:
SAXException

onEndElement

public void onEndElement(String namespace,
                         String localName,
                         DeserializationContext context)
                  throws SAXException
Check that we have a valid bean instance

Specified by:
onEndElement in interface Deserializer
Overrides:
onEndElement in class DeserializerImpl
Parameters:
namespace - is the namespace of the child element
localName - is the local name of the child element
context - is the deserialization context
Throws:
SAXException

getAnyPropertyDesc

public BeanPropertyDescriptor getAnyPropertyDesc()
Get a BeanPropertyDescriptor which indicates where we should put extensibility elements (i.e. XML which falls under the auspices of an <xsd:any> declaration in the schema)

Returns:
an appropriate BeanPropertyDescriptor, or null

getDeserializer

protected Deserializer getDeserializer(javax.xml.namespace.QName xmlType,
                                       Class javaType,
                                       String href,
                                       DeserializationContext context)
Get the Deserializer for the attribute or child element.

Parameters:
xmlType - QName of the attribute/child element or null if not known.
javaType - Class of the corresponding property
href - String is the value of the href attribute, which is used to determine whether the child element is complete or an href to another element.
context - DeserializationContext
Returns:
Deserializer or null if not found.

characters

public void characters(char[] p1,
                       int p2,
                       int p3)
                throws SAXException
This will assign text content to the bean property that is an element with the asContent flag set to true. There can only be one, or is there a way to know which? TDI 22-June-2004

Specified by:
characters in interface ContentHandler
Throws:
SAXException


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.