Methods Summary |
---|
public static org.apache.axis.encoding.SerializerFactory | createFactory(java.lang.Class factory, java.lang.Class javaType, javax.xml.namespace.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 ()
if (factory == null) {
return null;
}
try {
if (factory == BeanSerializerFactory.class) {
return new BeanSerializerFactory(javaType, xmlType);
} else if (factory == SimpleSerializerFactory.class) {
return new SimpleSerializerFactory(javaType, xmlType);
} else if (factory == EnumSerializerFactory.class) {
return new EnumSerializerFactory(javaType, xmlType);
} else if (factory == ElementSerializerFactory.class) {
return new ElementSerializerFactory();
} else if (factory == SimpleListSerializerFactory.class) {
return new SimpleListSerializerFactory(javaType, xmlType);
}
} catch (Exception e) {
if (log.isDebugEnabled()) {
log.debug(org.apache.axis.utils.Messages.getMessage("exception00"), e);
}
return null;
}
SerializerFactory sf = null;
try {
Method method =
factory.getMethod("create", CLASS_QNAME_CLASS);
sf = (SerializerFactory)
method.invoke(null,
new Object[] {javaType, xmlType});
} catch (NoSuchMethodException e) {
if(log.isDebugEnabled()) {
log.debug(org.apache.axis.utils.Messages.getMessage("exception00"), e);
}
} catch (IllegalAccessException e) {
if(log.isDebugEnabled()) {
log.debug(org.apache.axis.utils.Messages.getMessage("exception00"), e);
}
} catch (InvocationTargetException e) {
if(log.isDebugEnabled()) {
log.debug(org.apache.axis.utils.Messages.getMessage("exception00"), e);
}
}
if (sf == null) {
try {
Constructor constructor =
factory.getConstructor(CLASS_QNAME_CLASS);
sf = (SerializerFactory)
constructor.newInstance(
new Object[] {javaType, xmlType});
} catch (NoSuchMethodException e) {
if(log.isDebugEnabled()) {
log.debug(org.apache.axis.utils.Messages.getMessage("exception00"), e);
}
} catch (InstantiationException e) {
if(log.isDebugEnabled()) {
log.debug(org.apache.axis.utils.Messages.getMessage("exception00"), e);
}
} catch (IllegalAccessException e) {
if(log.isDebugEnabled()) {
log.debug(org.apache.axis.utils.Messages.getMessage("exception00"), e);
}
} catch (InvocationTargetException e) {
if(log.isDebugEnabled()) {
log.debug(org.apache.axis.utils.Messages.getMessage("exception00"), e);
}
}
}
if (sf == null) {
try {
sf = (SerializerFactory) factory.newInstance();
} catch (InstantiationException e) {
} catch (IllegalAccessException e) {}
}
return sf;
|
private java.lang.reflect.Constructor | getConstructor(java.lang.Class clazz)return constructor for class if any
try {
return clazz.getConstructor(CLASS_QNAME_CLASS);
} catch (NoSuchMethodException e) {}
return null;
|
protected org.apache.axis.encoding.Serializer | getGeneralPurpose(java.lang.String mechanismType)Obtains a serializer by invoking (javaType, xmlType)
on the serClass.
if (javaType != null && xmlType != null) {
Constructor serClassConstructor = getSerClassConstructor();
if (serClassConstructor != null) {
try {
return (Serializer)
serClassConstructor.newInstance(
new Object[] {javaType, xmlType});
} catch (InstantiationException e) {
if(log.isDebugEnabled()) {
log.debug(org.apache.axis.utils.Messages.getMessage("exception00"), e);
}
} catch (IllegalAccessException e) {
if(log.isDebugEnabled()) {
log.debug(org.apache.axis.utils.Messages.getMessage("exception00"), e);
}
} catch (InvocationTargetException e) {
if(log.isDebugEnabled()) {
log.debug(org.apache.axis.utils.Messages.getMessage("exception00"), e);
}
}
}
}
return null;
|
protected java.lang.reflect.Method | getGetSerializer()Returns the getSerializer.
if (getSerializer == null) {
getSerializer = getMethod(javaType, "getSerializer");
}
return getSerializer;
|
public java.lang.Class | getJavaType()get javaType
return javaType;
|
protected java.lang.reflect.Constructor | getSerClassConstructor()Returns the serClassConstructor.
if (serClassConstructor == null) {
serClassConstructor = getConstructor(serClass);
}
return serClassConstructor;
|
public javax.xml.rpc.encoding.Serializer | getSerializerAs(java.lang.String mechanismType)
synchronized (this) {
if (ser==null) {
ser = getSerializerAsInternal(mechanismType);
}
return ser;
}
|
protected org.apache.axis.encoding.Serializer | getSerializerAsInternal(java.lang.String mechanismType)
// Try getting a specialized Serializer
Serializer serializer = getSpecialized(mechanismType);
// Try getting a general purpose Serializer via constructor
// invocation
if (serializer == null) {
serializer = getGeneralPurpose(mechanismType);
}
try {
// If not successfull, try newInstance
if (serializer == null) {
serializer = (Serializer) serClass.newInstance();
}
} catch (Exception e) {
throw new JAXRPCException(
Messages.getMessage("CantGetSerializer",
serClass.getName()),
e);
}
return serializer;
|
protected org.apache.axis.encoding.Serializer | getSpecialized(java.lang.String mechanismType)Obtains a serializer by invoking getSerializer method in the
javaType class or its Helper class.
if (javaType != null && xmlType != null) {
Method getSerializer = getGetSerializer();
if (getSerializer != null) {
try {
return (Serializer)
getSerializer.invoke(
null,
new Object[] {mechanismType,
javaType,
xmlType});
} catch (IllegalAccessException e) {
if(log.isDebugEnabled()) {
log.debug(org.apache.axis.utils.Messages.getMessage("exception00"), e);
}
} catch (InvocationTargetException e) {
if(log.isDebugEnabled()) {
log.debug(org.apache.axis.utils.Messages.getMessage("exception00"), e);
}
}
}
}
return null;
|
public java.util.Iterator | getSupportedMechanismTypes()Returns a list of all XML processing mechanism types supported
by this SerializerFactory.
if (mechanisms == null) {
mechanisms = new Vector(1);
mechanisms.add(Constants.AXIS_SAX);
}
return mechanisms.iterator();
|
public javax.xml.namespace.QName | getXMLType()get xmlType
return xmlType;
|