117 */ |
117 */ |
118 public TypeInfo toItemType() { |
118 public TypeInfo toItemType() { |
119 // if we are to reinstitute this check, check JAXB annotations only |
119 // if we are to reinstitute this check, check JAXB annotations only |
120 // assert annotations.length==0; // not designed to work with adapters. |
120 // assert annotations.length==0; // not designed to work with adapters. |
121 Type t = (genericType != null)? genericType : type; |
121 Type t = (genericType != null)? genericType : type; |
122 Type base = Navigator.REFLECTION.getBaseClass(t, Collection.class); |
122 Type base = Utils.REFLECTION_NAVIGATOR.getBaseClass(t, Collection.class); |
123 if(base==null) |
123 if(base==null) |
124 return this; // not a collection |
124 return this; // not a collection |
125 |
125 |
126 return new TypeInfo(tagName, |
126 return new TypeInfo(tagName, Utils.REFLECTION_NAVIGATOR.getTypeArgument(base,0)); |
127 Navigator.REFLECTION.getTypeArgument(base,0)); |
|
128 } |
127 } |
129 |
128 |
130 public Map<String, Object> properties() { |
129 public Map<String, Object> properties() { |
131 return properties; |
130 return properties; |
132 } |
131 } |
186 if (genericComponentType != null) ti.setGenericType(genericComponentType); |
185 if (genericComponentType != null) ti.setGenericType(genericComponentType); |
187 return ti; |
186 return ti; |
188 } |
187 } |
189 // if (type instanceof Class && java.util.Collection.class.isAssignableFrom((Class)type)) { |
188 // if (type instanceof Class && java.util.Collection.class.isAssignableFrom((Class)type)) { |
190 Type t = (genericType != null)? genericType : type; |
189 Type t = (genericType != null)? genericType : type; |
191 Type base = Navigator.REFLECTION.getBaseClass(t, Collection.class); |
190 Type base = Utils.REFLECTION_NAVIGATOR.getBaseClass(t, Collection.class); |
192 if ( base != null) { |
191 if ( base != null) { |
193 return new TypeInfo(tagName, Navigator.REFLECTION.getTypeArgument(base,0), annotations); |
192 return new TypeInfo(tagName, Utils.REFLECTION_NAVIGATOR.getTypeArgument(base,0), annotations); |
194 } |
193 } |
195 return null; |
194 return null; |
196 } |
195 } |
197 } |
196 } |