org.apache.axis.encoding.ser
Class BaseSerializerFactory

java.lang.Object
  |
  +--org.apache.axis.encoding.ser.BaseSerializerFactory
All Implemented Interfaces:
java.io.Serializable, SerializerFactory, SerializerFactory
Direct Known Subclasses:
ArraySerializerFactory, Base64SerializerFactory, BeanSerializerFactory, CalendarSerializerFactory, DateSerializerFactory, ElementSerializerFactory, EnumSerializerFactory, HexSerializerFactory, JAFDataHandlerSerializerFactory, MapSerializerFactory, QNameSerializerFactory, SimpleNonPrimitiveSerializerFactory, SimplePrimitiveSerializerFactory, VectorSerializerFactory

public abstract class BaseSerializerFactory
extends java.lang.Object
implements SerializerFactory

Base class for Axis Serialization Factory classes for code reuse

Author:
Rich Scheuerle
See Also:
Serialized Form

Field Summary
protected  boolean firstCall
           
protected  java.lang.reflect.Method getSerializer
           
protected  java.lang.Class javaType
           
protected  Serializer ser
           
protected  java.lang.Class serClass
           
protected  java.lang.reflect.Constructor serClassConstructor
           
protected  boolean share
           
protected  QName xmlType
           
 
Constructor Summary
BaseSerializerFactory(java.lang.Class serClass, boolean share)
          Constructor
BaseSerializerFactory(java.lang.Class serClass, boolean share, QName xmlType, java.lang.Class javaType)
           
 
Method Summary
static SerializerFactory createFactory(java.lang.Class factory, java.lang.Class javaType, QName xmlType)
          Utility method that intospects on a factory class to decide how to create the factory.
protected  Serializer getGeneralPurpose(java.lang.String mechanismType)
          Obtains a serializer by invoking (javaType, xmlType) on the serClass.
 Serializer getSerializerAs(java.lang.String mechanismType)
          Returns a Serializer for the specified XML processing mechanism type.
protected  Serializer getSpecialized(java.lang.String mechanismType)
          Obtains a serializer by invoking getSerializer method in the javaType class or its Helper class.
 java.util.Iterator getSupportedMechanismTypes()
          Returns a list of all XML processing mechanism types supported by this SerializerFactory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serClass

protected java.lang.Class serClass

share

protected boolean share

ser

protected Serializer ser

xmlType

protected QName xmlType

javaType

protected java.lang.Class javaType

serClassConstructor

protected java.lang.reflect.Constructor serClassConstructor

getSerializer

protected java.lang.reflect.Method getSerializer

firstCall

protected boolean firstCall
Constructor Detail

BaseSerializerFactory

public BaseSerializerFactory(java.lang.Class serClass,
                             boolean share)
Constructor
Parameters:
serClass - is the class of the Serializer
share - indicates if serializers can be shared. getSerializerAs will always return the same serializer object if share is true. Sharing is only valid for xml primitives.

BaseSerializerFactory

public BaseSerializerFactory(java.lang.Class serClass,
                             boolean share,
                             QName xmlType,
                             java.lang.Class javaType)
Method Detail

getSerializerAs

public Serializer getSerializerAs(java.lang.String mechanismType)
                           throws JAXRPCException
Description copied from interface: SerializerFactory
Returns a Serializer for the specified XML processing mechanism type.
Specified by:
getSerializerAs in interface SerializerFactory
Following copied from interface: javax.xml.rpc.encoding.SerializerFactory
Parameters:
mechanismType - - XML processing mechanism type [TBD: definition of valid constants]
Returns:
a Serializer for the specified XML processing mechanism type.
Throws:
JAXRPCException -  

getGeneralPurpose

protected Serializer getGeneralPurpose(java.lang.String mechanismType)
Obtains a serializer by invoking (javaType, xmlType) on the serClass.

getSpecialized

protected Serializer getSpecialized(java.lang.String mechanismType)
Obtains a serializer by invoking getSerializer method in the javaType class or its Helper class.

getSupportedMechanismTypes

public java.util.Iterator getSupportedMechanismTypes()
Returns a list of all XML processing mechanism types supported by this SerializerFactory.
Specified by:
getSupportedMechanismTypes in interface SerializerFactory
Returns:
List of unique identifiers for the supported XML processing mechanism types

createFactory

public static SerializerFactory createFactory(java.lang.Class factory,
                                              java.lang.Class javaType,
                                              QName xmlType)
Utility method that intospects on a factory class to decide how to create the factory. Tries in the following order: public static create(Class javaType, QName xmlType) public (Class javaType, QName xmlType) public ()
Parameters:
factory - class
QName - xmlType
Class - javaType


Copyright © 2001 Apache XML Project. All Rights Reserved.