org.apache.axis.encoding.ser
Class BeanDeserializer

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

public class BeanDeserializer
extends org.apache.axis.encoding.DeserializerImpl
implements Serializable

General purpose deserializer for an arbitrary java bean.

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

Field Summary
 
Fields inherited from class org.apache.axis.message.SOAPHandler
myElement
 
Constructor Summary
BeanDeserializer(Class javaType, QName xmlType)
           
BeanDeserializer(Class javaType, QName xmlType, org.apache.axis.description.TypeDesc typeDesc)
           
BeanDeserializer(Class javaType, QName xmlType, org.apache.axis.description.TypeDesc typeDesc, Map propertyMap)
           
 
Method Summary
 void characters(char[] chars, int start, int end)
           
 org.apache.axis.utils.BeanPropertyDescriptor getAnyPropertyDesc()
          Get a BeanPropertyDescriptor which indicates where we should put extensibility elements (i.e.
 void onEndElement(String namespace, String localName, org.apache.axis.encoding.DeserializationContext context)
           
 org.apache.axis.message.SOAPHandler onStartChild(String namespace, String localName, String prefix, Attributes attributes, org.apache.axis.encoding.DeserializationContext context)
          Deserializer interface called on each child element encountered in the XML stream.
 void onStartElement(String namespace, String localName, String prefix, Attributes attributes, org.apache.axis.encoding.DeserializationContext context)
          Set the bean properties that correspond to element attributes.
 void startElement(String namespace, String localName, String prefix, Attributes attributes, org.apache.axis.encoding.DeserializationContext context)
          startElement The ONLY reason that this method is overridden is so that the object value can be set or a reasonable exception is thrown indicating that the object cannot be created.
 
Methods inherited from class org.apache.axis.encoding.DeserializerImpl
addChildDeserializer, componentsReady, endElement, getDefaultType, getMechanismType, getValue, getValue, getValueTargets, moveValueTargets, registerValueTarget, removeValueTargets, setChildValue, setDefaultType, setValue, setValue, 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
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanDeserializer

public BeanDeserializer(Class javaType,
                        QName xmlType)

BeanDeserializer

public BeanDeserializer(Class javaType,
                        QName xmlType,
                        org.apache.axis.description.TypeDesc typeDesc)

BeanDeserializer

public BeanDeserializer(Class javaType,
                        QName xmlType,
                        org.apache.axis.description.TypeDesc typeDesc,
                        Map propertyMap)
Method Detail

startElement

public void startElement(String namespace,
                         String localName,
                         String prefix,
                         Attributes attributes,
                         org.apache.axis.encoding.DeserializationContext context)
                  throws SAXException
startElement The ONLY reason that this method is overridden is so that the object value can be set or a reasonable exception is thrown indicating that the object cannot be created. This is done at this point so that it occurs BEFORE href/id processing.

Overrides:
startElement in class org.apache.axis.encoding.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 org.apache.axis.message.SOAPHandler onStartChild(String namespace,
                                                        String localName,
                                                        String prefix,
                                                        Attributes attributes,
                                                        org.apache.axis.encoding.DeserializationContext context)
                                                 throws SAXException
Deserializer interface called on each child element encountered in the XML stream.

Overrides:
onStartChild in class org.apache.axis.encoding.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

getAnyPropertyDesc

public org.apache.axis.utils.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

onStartElement

public void onStartElement(String namespace,
                           String localName,
                           String prefix,
                           Attributes attributes,
                           org.apache.axis.encoding.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.)

Overrides:
onStartElement in class org.apache.axis.encoding.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

characters

public void characters(char[] chars,
                       int start,
                       int end)
                throws SAXException
Specified by:
characters in interface ContentHandler
Overrides:
characters in class org.apache.axis.message.SOAPHandler
Throws:
SAXException

onEndElement

public void onEndElement(String namespace,
                         String localName,
                         org.apache.axis.encoding.DeserializationContext context)
                  throws SAXException
Overrides:
onEndElement in class org.apache.axis.encoding.DeserializerImpl
Throws:
SAXException


Copyright © 2012 Railo