org.apache.axis.encoding
Class BeanSerializer

java.lang.Object
  |
  +--org.xml.sax.helpers.DefaultHandler
        |
        +--org.apache.axis.message.SOAPHandler
              |
              +--org.apache.axis.encoding.Deserializer
                    |
                    +--org.apache.axis.encoding.BeanSerializer
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler, java.io.Serializable, Serializer

public class BeanSerializer
extends Deserializer
implements Serializer, java.io.Serializable

General purpose serializer/deserializerFactory for an arbitrary java bean.

Author:
Sam Ruby
See Also:
Serialized Form

Inner Class Summary
static class BeanSerializer.BeanSerFactory
          BeanSerializer Factory that creates instances with the specified class.
 
Inner classes inherited from class org.apache.axis.encoding.Deserializer
Deserializer.FieldTarget, Deserializer.MethodTarget
 
Fields inherited from class org.apache.axis.encoding.Deserializer
isComplete, targets, value
 
Fields inherited from class org.apache.axis.message.SOAPHandler
myElement
 
Constructor Summary
BeanSerializer()
          Default constructor.
BeanSerializer(java.lang.Class cls)
          Constructor that takes a class.
 
Method Summary
static DeserializerFactory getFactory()
           
protected  java.beans.PropertyDescriptor[] getPd()
           
protected  java.beans.PropertyDescriptor[] getPd(java.lang.Object val)
           
 SOAPHandler onStartChild(java.lang.String namespace, java.lang.String localName, java.lang.String prefix, org.xml.sax.Attributes attributes, DeserializationContext context)
          Deserializer interface called on each child element encountered in the XML stream.
 void serialize(QName name, org.xml.sax.Attributes attributes, java.lang.Object value, SerializationContext context)
          Serialize a bean.
protected  void setCls(java.lang.Class cls)
           
protected  void setPd(java.beans.PropertyDescriptor[] pd)
           
 
Methods inherited from class org.apache.axis.encoding.Deserializer
copyValueTargets, endElement, getValue, onEndElement, onStartElement, registerCallback, registerValueTarget, registerValueTarget, setValue, startElement, valueComplete
 
Methods inherited from class org.apache.axis.message.SOAPHandler
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
 

Constructor Detail

BeanSerializer

public BeanSerializer()
Default constructor.

BeanSerializer

public BeanSerializer(java.lang.Class cls)
Constructor that takes a class. Provided only for convenience. Equivalent to calling setCls(cls) on a new instance.
Method Detail

setCls

protected void setCls(java.lang.Class cls)

getPd

protected java.beans.PropertyDescriptor[] getPd()

getPd

protected java.beans.PropertyDescriptor[] getPd(java.lang.Object val)

setPd

protected void setPd(java.beans.PropertyDescriptor[] pd)

getFactory

public static DeserializerFactory getFactory()

onStartChild

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

serialize

public void serialize(QName name,
                      org.xml.sax.Attributes attributes,
                      java.lang.Object value,
                      SerializationContext context)
               throws java.io.IOException
Serialize a bean. Done simply by serializing each bean property.
Specified by:
serialize in interface Serializer


Copyright © 2001 Apache XML Project. All Rights Reserved.