WSIFMessage context)
throws WSIFException {
Class objClass;
String namespaceURI, localPart;
WSIFDynamicTypeMapping wsifdynamictypemapping;
for (Iterator iterator = typeMap.iterator(); iterator.hasNext();) {
wsifdynamictypemapping = (WSIFDynamicTypeMapping) iterator.next();
objClass = wsifdynamictypemapping.getJavaType();
QName xmlType = wsifdynamictypemapping.getXmlType();
SerializerFactory sf = null;
DeserializerFactory df = null;
// the context may override the default (de)serializer for a type
TypeSerializerInfo contextTypeSerializer =
findContextTypeSerialzer(context, objClass, xmlType);
if (contextTypeSerializer != null) {
objClass = contextTypeSerializer.getJavaType();
xmlType = contextTypeSerializer.getElementType();
sf = (SerializerFactory) contextTypeSerializer.getSerializer();
df = (DeserializerFactory) contextTypeSerializer.getDeserializer();
}
if (sf == null && tm.getSerializer(objClass, xmlType) == null) {
if (objClass.isArray()) {
sf = new ArraySerializerFactory();
} else if (SimpleType.class.isAssignableFrom(objClass)) {
sf = new SimpleSerializerFactory(objClass, xmlType);
} else {
sf = new BeanSerializerFactory(objClass, xmlType);
}
}
if (df == null && tm.getDeserializer(objClass, xmlType) == null) {
if (objClass.isArray()) {
df = new ArrayDeserializerFactory();
} else if (SimpleType.class.isAssignableFrom(objClass)) {
df = new SimpleDeserializerFactory(objClass, xmlType);
} else {
df = new BeanDeserializerFactory(objClass, xmlType);
}
}
namespaceURI =
wsifdynamictypemapping.getXmlType().getNamespaceURI();
// Filter out XSD and SOAP-ENC types from those we explicitly map.
// Axis already knows how to deal with these; using the BeanSerializer
// would be wrong anyway as they represent simple types and not beans.
if (!isDefaultSOAPNamespace(namespaceURI) ) {
localPart = wsifdynamictypemapping.getXmlType().getLocalPart();
QName qn = new QName(namespaceURI, localPart);
if (sf != null || df != null) {
tm.register(objClass, qn, sf, df);
}