1 55 56 package org.jboss.axis.encoding.ser; 57 58 import org.jboss.axis.attachments.OctetStream; 59 import org.jboss.logging.Logger; 60 61 import javax.mail.internet.MimeMultipart ; 62 import javax.xml.namespace.QName ; 63 import javax.xml.transform.Source ; 64 import java.awt.*; 65 66 71 public class JAFDataHandlerDeserializerFactory extends BaseDeserializerFactory 72 { 73 private static Logger log = Logger.getLogger(JAFDataHandlerDeserializerFactory.class.getName()); 74 75 public JAFDataHandlerDeserializerFactory(Class javaType, QName xmlType) 76 { 77 super(getDeserializerClass(javaType, xmlType), xmlType, javaType); 78 log.debug("Enter/Exit: JAFDataHandlerDeserializerFactory(" + javaType + ", " 79 + xmlType + ")"); 80 } 81 82 public JAFDataHandlerDeserializerFactory() 83 { 84 super(JAFDataHandlerDeserializer.class); 85 log.debug("Enter/Exit: JAFDataHandlerDeserializerFactory()"); 86 } 87 88 private static Class getDeserializerClass(Class javaType, QName xmlType) 89 { 90 Class deser; 91 if (Image.class.isAssignableFrom(javaType)) 92 { 93 deser = ImageDataHandlerDeserializer.class; 94 } 95 else if (String .class.isAssignableFrom(javaType)) 96 { 97 deser = PlainTextDataHandlerDeserializer.class; 98 } 99 else if (Source .class.isAssignableFrom(javaType)) 100 { 101 deser = SourceDataHandlerDeserializer.class; 102 } 103 else if (MimeMultipart .class.isAssignableFrom(javaType)) 104 { 105 deser = MimeMultipartDataHandlerDeserializer.class; 106 } 107 else if (OctetStream.class.isAssignableFrom(javaType)) 108 { 109 deser = OctetStreamDataHandlerDeserializer.class; 110 } 111 else 112 { 113 deser = JAFDataHandlerDeserializer.class; 114 } 115 return deser; 116 } } 118 | Popular Tags |