1 17 package org.apache.geronimo.axis.client; 18 19 import javax.xml.namespace.QName ; 20 import javax.xml.rpc.encoding.TypeMapping ; 21 import javax.xml.rpc.encoding.SerializerFactory ; 22 import javax.xml.rpc.encoding.DeserializerFactory ; 23 24 import org.apache.axis.description.FieldDesc; 25 import org.apache.axis.encoding.ser.BaseSerializerFactory; 26 import org.apache.axis.encoding.ser.BaseDeserializerFactory; 27 import org.apache.axis.encoding.ser.ArraySerializerFactory; 28 import org.apache.axis.encoding.ser.ArrayDeserializerFactory; 29 30 33 public class ArrayTypeInfo extends TypeInfo { 34 35 private final QName componentType; 36 private final QName componentQName; 37 38 public ArrayTypeInfo(Class clazz, 39 QName qName, 40 Class serializerClass, 41 Class deserializerClass, 42 boolean canSearchParents, 43 FieldDesc[] fields, 44 QName componentType, 45 QName componentQName) { 46 super(clazz, qName, serializerClass, deserializerClass, canSearchParents, fields); 47 this.componentType = componentType; 48 this.componentQName = componentQName; 49 } 50 51 public void register(TypeMapping typeMapping) { 52 58 ArraySerializerFactory ser = new ArraySerializerFactory(componentType, componentQName); 59 ArrayDeserializerFactory deser = new ArrayDeserializerFactory(); 60 61 typeMapping.register(getClazz(), getqName(), ser, deser); 62 } 63 64 public static class UpdatableArrayTypeInfo extends TypeInfo.UpdatableTypeInfo { 65 private QName componentType; 66 private QName componentQName; 67 68 public TypeInfo buildTypeInfo() { 69 if (null == clazz) { 70 throw new IllegalStateException ("clazz is null"); 71 } else if (null == qName) { 72 throw new IllegalStateException ("qName is null"); 73 } else if (null == serializerClass) { 74 throw new IllegalStateException ("serializerClass is null"); 75 } else if (null == deserializerClass) { 76 throw new IllegalStateException ("deserializerClass is null"); 77 } else if (null == fields) { 78 throw new IllegalStateException ("fields is null"); 79 } 80 return new ArrayTypeInfo(clazz, qName, serializerClass, deserializerClass, canSearchParents, fields, componentType, componentQName); 81 } 82 83 84 public QName getComponentType() { 85 return componentType; 86 } 87 88 public QName getComponentQName() { 89 return componentQName; 90 } 91 92 public void setComponentType(QName componentType) { 93 this.componentType = componentType; 94 } 95 96 public void setComponentQName(QName componentQName) { 97 this.componentQName = componentQName; 98 } 99 100 } 101 102 103 } 104 | Popular Tags |