org.jboss.net.axis.server
Class EntityBeanDeserializer

java.lang.Object
  extended byorg.xml.sax.helpers.DefaultHandler
      extended byorg.jboss.axis.message.SOAPHandler (src) 
          extended byorg.jboss.axis.encoding.DeserializerImpl (src) 
              extended byorg.jboss.net.axis.server.EntityBeanDeserializer
All Implemented Interfaces:
Callback (src) , org.xml.sax.ContentHandler, Deserializer (src) , Deserializer (src) , org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler, ParameterizableDeserializer (src) , java.io.Serializable

public class EntityBeanDeserializer
extends DeserializerImpl (src)
implements ParameterizableDeserializer (src)

Server-side deserializer hitting an existing entity bean. Derived from the axis BeanDeserializer. Currently relies on some silly conventions that must be configurable in the deployment descriptor.

See Also:
Serialized Form

Nested Class Summary
 class EntityBeanDeserializer.BeanPropertyTarget (src)
          Class which knows how to update a bean property
 class EntityBeanDeserializer.FindPropertyTarget (src)
           
 
Field Summary
protected  int collectionIndex
           
protected  java.util.Collection fieldSetters
           
protected  java.util.List findElements
           
protected  java.lang.reflect.Method findMethod
           
protected  java.lang.Object[] findObjects
           
protected  java.lang.Object home
           
protected  boolean initialized
           
protected  java.lang.Class javaType
           
protected  java.util.Map options
           
protected  java.util.Map propertyMap
           
protected  TypeDesc (src) typeDesc
           
protected  QName (src) xmlType
           
 
Fields inherited from class org.jboss.axis.encoding.DeserializerImpl (src)
defaultType, id, isEnded, isHref, isNil, targets, value
 
Fields inherited from class org.jboss.axis.message.SOAPHandler (src)
myElement
 
Constructor Summary
EntityBeanDeserializer(java.lang.Class remoteType, QName (src)  xmlType)
          Construct a new BeanSerializer
 
Method Summary
 java.util.Map getOptions()
          return the set of options
static org.jboss.net.axis.server.EntityBeanDeserializer.BeanPropertyDescriptor[] getPd(java.lang.Class javaType)
          Create a BeanPropertyDescriptor array for the indicated class.
protected  java.lang.String getStringOption(java.lang.String key, java.lang.String def)
          returns an option string with a default
protected  void initialize(MessageContext (src)  ctx)
          initialize the deserializer
 void onEndElement(java.lang.String namespace, java.lang.String localName, DeserializationContext (src)  context)
          onEndElement is called by endElement.
 SOAPHandler (src) onStartChild(java.lang.String namespace, java.lang.String localName, java.lang.String prefix, org.xml.sax.Attributes attributes, DeserializationContext (src)  context)
          Deserializer interface called on each child element encountered in the XML stream.
 void onStartElement(java.lang.String namespace, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes, DeserializationContext (src)  context)
          Set the bean properties that correspond to element attributes.
 void setOptions(java.util.Map options)
          register a set of options
 
Methods inherited from class org.jboss.axis.encoding.DeserializerImpl (src)
addChildDeserializer, componentsReady, endElement, getDefaultType, getMechanismType, getValue, getValue, getValueTargets, moveValueTargets, registerValueTarget, removeValueTargets, setChildValue, setDefaultType, setValue, setValue, startElement, valueComplete
 
Methods inherited from class org.jboss.axis.message.SOAPHandler (src)
makeNewElement, onEndChild
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, 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
 
Methods inherited from interface javax.xml.rpc.encoding.Deserializer (src)
getMechanismType
 

Field Detail

options

protected java.util.Map options

home

protected java.lang.Object home

findMethod

protected java.lang.reflect.Method findMethod

findElements

protected java.util.List findElements

findObjects

protected java.lang.Object[] findObjects

typeDesc

protected TypeDesc (src)  typeDesc

xmlType

protected QName (src)  xmlType

javaType

protected java.lang.Class javaType

propertyMap

protected java.util.Map propertyMap

collectionIndex

protected int collectionIndex

fieldSetters

protected java.util.Collection fieldSetters

initialized

protected boolean initialized
Constructor Detail

EntityBeanDeserializer

public EntityBeanDeserializer(java.lang.Class remoteType,
                              QName (src)  xmlType)
                       throws java.lang.Exception
Construct a new BeanSerializer

Parameters:
remoteType - remote interface of the entity bean
xmlType - fully-qualified xml tag-name of the corresponding xml structure
Method Detail

getStringOption

protected java.lang.String getStringOption(java.lang.String key,
                                           java.lang.String def)
returns an option string with a default


initialize

protected void initialize(MessageContext (src)  ctx)
                   throws org.xml.sax.SAXException
initialize the deserializer

Throws:
org.xml.sax.SAXException

setOptions

public void setOptions(java.util.Map options)
Description copied from interface: ParameterizableDeserializer (src)
register a set of options

Specified by:
setOptions in interface ParameterizableDeserializer (src)

getOptions

public java.util.Map getOptions()
Description copied from interface: ParameterizableDeserializer (src)
return the set of options

Specified by:
getOptions in interface ParameterizableDeserializer (src)

onStartChild

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

Specified by:
onStartChild in interface Deserializer (src)
Overrides:
onStartChild in class DeserializerImpl (src)
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:
org.xml.sax.SAXException

onStartElement

public void onStartElement(java.lang.String namespace,
                           java.lang.String localName,
                           java.lang.String qName,
                           org.xml.sax.Attributes attributes,
                           DeserializationContext (src)  context)
                    throws org.xml.sax.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 (src)
Overrides:
onStartElement in class DeserializerImpl (src)
Parameters:
namespace - is the namespace of the element
localName - is the name of the element
qName - is the prefixed qName of the element
attributes - are the attributes on the element...used to get the type
context - is the DeserializationContext
Throws:
org.xml.sax.SAXException

onEndElement

public void onEndElement(java.lang.String namespace,
                         java.lang.String localName,
                         DeserializationContext (src)  context)
                  throws org.xml.sax.SAXException
Description copied from class: DeserializerImpl (src)
onEndElement is called by endElement. It is not called if the element has an href.

Specified by:
onEndElement in interface Deserializer (src)
Overrides:
onEndElement in class DeserializerImpl (src)
Parameters:
namespace - is the namespace of the child element
localName - is the local name of the child element
context - is the deserialization context
Throws:
org.xml.sax.SAXException

getPd

public static org.jboss.net.axis.server.EntityBeanDeserializer.BeanPropertyDescriptor[] getPd(java.lang.Class javaType)
Create a BeanPropertyDescriptor array for the indicated class.