1 16 17 package org.apache.axis.encoding.ser; 18 19 import org.apache.axis.components.logger.LogFactory; 20 import org.apache.axis.attachments.OctetStream; 21 import org.apache.commons.logging.Log; 22 23 import javax.mail.internet.MimeMultipart ; 24 import javax.xml.namespace.QName ; 25 import javax.xml.transform.Source ; 26 import java.awt.*; 27 28 33 public class JAFDataHandlerDeserializerFactory extends BaseDeserializerFactory { 34 protected static Log log = 35 LogFactory.getLog(JAFDataHandlerDeserializerFactory.class.getName()); 36 37 public JAFDataHandlerDeserializerFactory(Class javaType, QName xmlType) { 38 super(getDeserializerClass(javaType, xmlType), xmlType, javaType); 39 log.debug("Enter/Exit: JAFDataHandlerDeserializerFactory(" + javaType + ", " 40 + xmlType + ")"); 41 } 42 public JAFDataHandlerDeserializerFactory() { 43 super(JAFDataHandlerDeserializer.class); 44 log.debug("Enter/Exit: JAFDataHandlerDeserializerFactory()"); 45 } 46 47 private static Class getDeserializerClass(Class javaType, QName xmlType) { 48 Class deser; 49 if (Image.class.isAssignableFrom(javaType)) { 50 deser = ImageDataHandlerDeserializer.class; 51 } 52 else if (String .class.isAssignableFrom(javaType)) { 53 deser = PlainTextDataHandlerDeserializer.class; 54 } 55 else if (Source .class.isAssignableFrom(javaType)) { 56 deser = SourceDataHandlerDeserializer.class; 57 } 58 else if (MimeMultipart .class.isAssignableFrom(javaType)) { 59 deser = MimeMultipartDataHandlerDeserializer.class; 60 } 61 else if (OctetStream.class.isAssignableFrom(javaType)) { 62 deser = OctetStreamDataHandlerDeserializer.class; 63 } 64 else { 65 deser = JAFDataHandlerDeserializer.class; 66 } 67 return deser; 68 } } 70 | Popular Tags |