private boolean addAllSubtypes(T type) { Navigator<T,C,F,M> nav = nav(); // this allows the explicitly referenced type to be sucked in to the model NonElement<T,C> t = parent.builder.getClassInfo(nav.asDecl(type),this); if(!(t instanceof ClassInfo)) // this is leaf. return false; boolean result = false; ClassInfo<T,C> c = (ClassInfo<T,C>) t; if(c.isElement()) { types.add(c.asElement()); result = true; } // look for other possible types for( ClassInfo<T,C> ci : parent.owner.beans().values() ) { if(ci.isElement() && nav.isSubClassOf(ci.getType(),type)) { types.add(ci.asElement()); result = true; } } // don't allow local elements to substitute. for( ElementInfo<T,C> ei : parent.owner.getElementMappings(null).values()) { if(nav.isSubClassOf(ei.getType(),type)) { types.add(ei); result = true; } } return result; }
/** * Checks if the given adapter is applicable to the declared property type. */ private boolean isApplicable(XmlJavaTypeAdapter jta, T declaredType ) { if(jta==null) return false; T type = reader().getClassValue(jta,"type"); if(nav().isSameType(declaredType, type)) return true; // for types explicitly marked in XmlJavaTypeAdapter.type() T ad = reader().getClassValue(jta,"value"); T ba = nav().getBaseClass(ad, nav().asDecl(XmlAdapter.class)); if(!nav().isParameterizedType(ba)) return true; // can't check type applicability. assume Object, which means applicable to any. T inMemType = nav().getTypeArgument(ba, 1); return nav().isSubClassOf(declaredType,inMemType); }
if(nav().isSubClassOf( seed.getRawType(), nav().ref(Map.class) ) && !seed.hasAnnotation(XmlJavaTypeAdapter.class)) group = PropertyGroup.MAP; group = PropertyGroup.ELEMENT; } else if (group.equals(PropertyGroup.ELEMENT)) { // see issue 791 - make sure @XmlElement annotated map property is mapped to map if (nav().isSubClassOf( seed.getRawType(), nav().ref(Map.class)) && !seed.hasAnnotation(XmlJavaTypeAdapter.class)) { group = PropertyGroup.MAP; if(!nav().isSubClassOf(seed.getRawType(),nav().ref(Map.class))) { builder.reportError(new IllegalAnnotationException( Messages.INVALID_ATTRIBUTE_WILDCARD_TYPE.format(nav().getTypeName(seed.getRawType())),
this.isCollection = nav().isSubClassOf(t, nav().ref(Collection.class)) || nav().isArrayButNotByteArray(t);
private boolean addAllSubtypes(T type) { Navigator<T,C,F,M> nav = nav(); // this allows the explicitly referenced type to be sucked in to the model NonElement<T,C> t = parent.builder.getClassInfo(nav.asDecl(type),this); if(!(t instanceof ClassInfo)) // this is leaf. return false; boolean result = false; ClassInfo<T,C> c = (ClassInfo<T,C>) t; if(c.isElement()) { types.add(c.asElement()); result = true; } // look for other possible types for( ClassInfo<T,C> ci : parent.owner.beans().values() ) { if(ci.isElement() && nav.isSubClassOf(ci.getType(),type)) { types.add(ci.asElement()); result = true; } } // don't allow local elements to substitute. for( ElementInfo<T,C> ei : parent.owner.getElementMappings(null).values()) { if(nav.isSubClassOf(ei.getType(),type)) { types.add(ei); result = true; } } return result; }
/** * Checks if the given adapter is applicable to the declared property type. */ private boolean isApplicable(XmlJavaTypeAdapter jta, T declaredType ) { if(jta==null) return false; T type = reader().getClassValue(jta,"type"); if(nav().isSameType(declaredType, type)) return true; // for types explicitly marked in XmlJavaTypeAdapter.type() T ad = reader().getClassValue(jta,"value"); T ba = nav().getBaseClass(ad, nav().asDecl(XmlAdapter.class)); if(!nav().isParameterizedType(ba)) return true; // can't check type applicability. assume Object, which means applicable to any. T inMemType = nav().getTypeArgument(ba, 1); return nav().isSubClassOf(declaredType,inMemType); }
if(nav().isSubClassOf( seed.getRawType(), nav().ref(Map.class) ) && !seed.hasAnnotation(XmlJavaTypeAdapter.class)) group = PropertyGroup.MAP; group = PropertyGroup.ELEMENT; } else if (group.equals(PropertyGroup.ELEMENT)) { // see issue 791 - make sure @XmlElement annotated map property is mapped to map if (nav().isSubClassOf( seed.getRawType(), nav().ref(Map.class)) && !seed.hasAnnotation(XmlJavaTypeAdapter.class)) { group = PropertyGroup.MAP; if(!nav().isSubClassOf(seed.getRawType(),nav().ref(Map.class))) { builder.reportError(new IllegalAnnotationException( Messages.INVALID_ATTRIBUTE_WILDCARD_TYPE.format(nav().getTypeName(seed.getRawType())),
this.isCollection = nav().isSubClassOf(t, nav().ref(Collection.class)) || nav().isArrayButNotByteArray(t);
private boolean addAllSubtypes(T type) { Navigator<T,C,F,M> nav = nav(); // this allows the explicitly referenced type to be sucked in to the model NonElement<T,C> t = parent.builder.getClassInfo(nav.asDecl(type),this); if(!(t instanceof ClassInfo)) // this is leaf. return false; boolean result = false; ClassInfo<T,C> c = (ClassInfo<T,C>) t; if(c.isElement()) { types.add(c.asElement()); result = true; } // look for other possible types for( ClassInfo<T,C> ci : parent.owner.beans().values() ) { if(ci.isElement() && nav.isSubClassOf(ci.getType(),type)) { types.add(ci.asElement()); result = true; } } // don't allow local elements to substitute. for( ElementInfo<T,C> ei : parent.owner.getElementMappings(null).values()) { if(nav.isSubClassOf(ei.getType(),type)) { types.add(ei); result = true; } } return result; }
private boolean addAllSubtypes(T type) { Navigator<T,C,F,M> nav = nav(); // this allows the explicitly referenced type to be sucked in to the model NonElement<T,C> t = parent.builder.getClassInfo(nav.asDecl(type),this); if(!(t instanceof ClassInfo)) // this is leaf. return false; boolean result = false; ClassInfo<T,C> c = (ClassInfo<T,C>) t; if(c.isElement()) { types.add(c.asElement()); result = true; } // look for other possible types for( ClassInfo<T,C> ci : parent.owner.beans().values() ) { if(ci.isElement() && nav.isSubClassOf(ci.getType(),type)) { types.add(ci.asElement()); result = true; } } // don't allow local elements to substitute. for( ElementInfo<T,C> ei : parent.owner.getElementMappings(null).values()) { if(nav.isSubClassOf(ei.getType(),type)) { types.add(ei); result = true; } } return result; }
/** * Checks if the given adapter is applicable to the declared property type. */ private boolean isApplicable(XmlJavaTypeAdapter jta, T declaredType ) { if(jta==null) return false; T type = reader().getClassValue(jta,"type"); if(nav().isSameType(declaredType, type)) return true; // for types explicitly marked in XmlJavaTypeAdapter.type() T ad = reader().getClassValue(jta,"value"); T ba = nav().getBaseClass(ad, nav().asDecl(XmlAdapter.class)); if(!nav().isParameterizedType(ba)) return true; // can't check type applicability. assume Object, which means applicable to any. T inMemType = nav().getTypeArgument(ba, 1); return nav().isSubClassOf(declaredType,inMemType); }
/** * Checks if the given adapter is applicable to the declared property type. */ private boolean isApplicable(XmlJavaTypeAdapter jta, T declaredType ) { if(jta==null) return false; T type = reader().getClassValue(jta,"type"); if(nav().isSameType(declaredType, type)) return true; // for types explicitly marked in XmlJavaTypeAdapter.type() T ad = reader().getClassValue(jta,"value"); T ba = nav().getBaseClass(ad, nav().asDecl(XmlAdapter.class)); if(!nav().isParameterizedType(ba)) return true; // can't check type applicability. assume Object, which means applicable to any. T inMemType = nav().getTypeArgument(ba, 1); return nav().isSubClassOf(declaredType,inMemType); }
if(nav().isSubClassOf( seed.getRawType(), nav().ref(Map.class) ) && !seed.hasAnnotation(XmlJavaTypeAdapter.class)) group = PropertyGroup.MAP; group = PropertyGroup.ELEMENT; } else if (group.equals(PropertyGroup.ELEMENT)) { // see issue 791 - make sure @XmlElement annotated map property is mapped to map if (nav().isSubClassOf( seed.getRawType(), nav().ref(Map.class)) && !seed.hasAnnotation(XmlJavaTypeAdapter.class)) { group = PropertyGroup.MAP; if(!nav().isSubClassOf(seed.getRawType(),nav().ref(Map.class))) { builder.reportError(new IllegalAnnotationException( Messages.INVALID_ATTRIBUTE_WILDCARD_TYPE.format(nav().getTypeName(seed.getRawType())),
if(nav().isSubClassOf( seed.getRawType(), nav().ref(Map.class) ) && !seed.hasAnnotation(XmlJavaTypeAdapter.class)) group = PropertyGroup.MAP; group = PropertyGroup.ELEMENT; } else if (group.equals(PropertyGroup.ELEMENT)) { // see issue 791 - make sure @XmlElement annotated map property is mapped to map if (nav().isSubClassOf( seed.getRawType(), nav().ref(Map.class)) && !seed.hasAnnotation(XmlJavaTypeAdapter.class)) { group = PropertyGroup.MAP; if(!nav().isSubClassOf(seed.getRawType(),nav().ref(Map.class))) { builder.reportError(new IllegalAnnotationException( Messages.INVALID_ATTRIBUTE_WILDCARD_TYPE.format(nav().getTypeName(seed.getRawType())),
this.isCollection = nav().isSubClassOf(t, nav().ref(Collection.class)) || nav().isArrayButNotByteArray(t);
this.isCollection = nav().isSubClassOf(t, nav().ref(Collection.class)) || nav().isArrayButNotByteArray(t);