1 29 30 package com.caucho.jaxb.skeleton; 31 32 import com.caucho.jaxb.JAXBContextImpl; 33 import com.caucho.util.L10N; 34 35 import javax.xml.bind.JAXBException; 36 import javax.xml.bind.annotation.XmlAttribute; 37 import javax.xml.bind.annotation.XmlElement; 38 import javax.xml.bind.annotation.XmlType; 39 import javax.xml.namespace.QName ; 40 import java.beans.PropertyDescriptor ; 41 import java.lang.annotation.Annotation ; 42 import java.lang.reflect.Field ; 43 import java.lang.reflect.GenericArrayType ; 44 import java.lang.reflect.Method ; 45 import java.lang.reflect.ParameterizedType ; 46 import java.lang.reflect.Type ; 47 import java.util.Map ; 48 49 public class ArrayComponentAccessor extends Accessor { 50 private Accessor _accessor; 51 private Class _type; 52 private Type _genericType; 53 54 public ArrayComponentAccessor(Accessor a) 55 { 56 super(a.getContext()); 57 58 _accessor = a; 59 60 _type = _accessor.getType().getComponentType(); 61 62 if (a.getGenericType() instanceof GenericArrayType ) { 63 GenericArrayType arrayType = (GenericArrayType ) a.getGenericType(); 64 _genericType = arrayType.getGenericComponentType(); 65 } 66 else { 67 _genericType = _type; 68 } 69 } 70 71 public Object get(Object o) throws JAXBException 72 { 73 throw new JAXBException("cannot invoke ArrayComponentAccessor.get()"); 74 } 75 76 public void set(Object o, Object value) throws JAXBException 77 { 78 throw new JAXBException("cannot invoke ArrayComponentAccessor.set()"); 79 } 80 81 public String getName() 82 { 83 return _accessor.getName(); 84 } 85 86 public Class getType() 87 { 88 return _type; 89 } 90 91 public Type getGenericType() 92 { 93 return _genericType; 94 } 95 96 public <A extends Annotation > A getAnnotation(Class <A> c) 97 { 98 return null; 99 } 100 } 101 | Popular Tags |