/** * Returns a {@link TypeInfo} for the given type. * * @return * null if the specified type cannot be bound by JAXB, or * not known to this set. */ public NonElement<T,C> getTypeInfo( T type ) { type = nav.erasure(type); // replace type variables by their bounds LeafInfo<T,C> l = builtins.get(type); if(l!=null) return l; if( nav.isArray(type) ) { return arrays.get(type); } C d = nav.asDecl(type); if(d==null) return null; return getClassInfo(d); }
/** * Have the builder recognize the type (if it hasn't done so yet), * and returns a {@link NonElement} that represents it. * * @return * always non-null. */ public NonElement<T,C> getTypeInfo(T t,Locatable upstream) { NonElement<T,C> r = typeInfoSet.getTypeInfo(t); if(r!=null) return r; if(nav.isArray(t)) { // no need for checking byte[], because above typeInfoset.getTypeInfo() would return non-null ArrayInfoImpl<T,C,F,M> ai = createArrayInfo(upstream, t); addTypeName(ai); typeInfoSet.add(ai); return ai; } C c = nav.asDecl(t); assert c!=null : t.toString()+" must be a leaf, but we failed to recognize it."; return getClassInfo(c,upstream); }
/** * Returns a {@link TypeInfo} for the given type. * * @return * null if the specified type cannot be bound by JAXB, or * not known to this set. */ public NonElement<T,C> getTypeInfo( T type ) { type = nav.erasure(type); // replace type variables by their bounds LeafInfo<T,C> l = builtins.get(type); if(l!=null) return l; if( nav.isArray(type) ) { return arrays.get(type); } C d = nav.asDecl(type); if(d==null) return null; return getClassInfo(d); }
/** * Have the builder recognize the type (if it hasn't done so yet), * and returns a {@link NonElement} that represents it. * * @return * always non-null. */ public NonElement<T,C> getTypeInfo(T t,Locatable upstream) { NonElement<T,C> r = typeInfoSet.getTypeInfo(t); if(r!=null) return r; if(nav.isArray(t)) { // no need for checking byte[], because above typeInfoset.getTypeInfo() would return non-null ArrayInfoImpl<T,C,F,M> ai = createArrayInfo(upstream, t); addTypeName(ai); typeInfoSet.add(ai); return ai; } C c = nav.asDecl(t); assert c!=null : t.toString()+" must be a leaf, but we failed to recognize it."; return getClassInfo(c,upstream); }
/** * Returns a {@link TypeInfo} for the given type. * * @return * null if the specified type cannot be bound by JAXB, or * not known to this set. */ public NonElement<T,C> getTypeInfo( T type ) { type = nav.erasure(type); // replace type variables by their bounds LeafInfo<T,C> l = builtins.get(type); if(l!=null) return l; if( nav.isArray(type) ) { return arrays.get(type); } C d = nav.asDecl(type); if(d==null) return null; return getClassInfo(d); }
/** * Returns a {@link TypeInfo} for the given type. * * @return * null if the specified type cannot be bound by JAXB, or * not known to this set. */ public NonElement<T,C> getTypeInfo( T type ) { type = nav.erasure(type); // replace type variables by their bounds LeafInfo<T,C> l = builtins.get(type); if(l!=null) return l; if( nav.isArray(type) ) { return arrays.get(type); } C d = nav.asDecl(type); if(d==null) return null; return getClassInfo(d); }
private void processXmlElement(List<Annotation> jaxb, String elemName, String elemNS, T type) { XmlElement elemAnn = null; for (Annotation a : jaxb) { if (a.annotationType() == XmlElement.class) { elemAnn = (XmlElement) a; jaxb.remove(a); break; } } String name = (elemAnn != null && !elemAnn.name().equals("##default")) ? elemAnn.name() : elemName; String ns = (elemAnn != null && !elemAnn.namespace().equals("##default")) ? elemAnn.namespace() : elemNS; boolean nillable = nav.isArray(type) || (elemAnn != null && elemAnn.nillable()); boolean required = elemAnn != null && elemAnn.required(); XmlElementHandler handler = new XmlElementHandler(name, ns, nillable, required); XmlElement elem = (XmlElement) Proxy.newProxyInstance(this.getClass().getClassLoader(), new Class<?>[]{XmlElement.class}, handler); jaxb.add(elem); }
private void processXmlElement(List<Annotation> jaxb, String elemName, String elemNS, T type) { XmlElement elemAnn = null; for (Annotation a : jaxb) { if (a.annotationType() == XmlElement.class) { elemAnn = (XmlElement) a; jaxb.remove(a); break; } } String name = (elemAnn != null && !elemAnn.name().equals("##default")) ? elemAnn.name() : elemName; String ns = (elemAnn != null && !elemAnn.namespace().equals("##default")) ? elemAnn.namespace() : elemNS; boolean nillable = nav.isArray(type) || (elemAnn != null && elemAnn.nillable()); boolean required = elemAnn != null && elemAnn.required(); XmlElementHandler handler = new XmlElementHandler(name, ns, nillable, required); XmlElement elem = (XmlElement) Proxy.newProxyInstance(this.getClass().getClassLoader(), new Class<?>[]{XmlElement.class}, handler); jaxb.add(elem); }
private void processXmlElement(List<Annotation> jaxb, String elemName, String elemNS, T type) { XmlElement elemAnn = null; for (Annotation a : jaxb) { if (a.annotationType() == XmlElement.class) { elemAnn = (XmlElement) a; jaxb.remove(a); break; } } String name = (elemAnn != null && !elemAnn.name().equals("##default")) ? elemAnn.name() : elemName; String ns = (elemAnn != null && !elemAnn.namespace().equals("##default")) ? elemAnn.namespace() : elemNS; boolean nillable = nav.isArray(type) || (elemAnn != null && elemAnn.nillable()); boolean required = elemAnn != null && elemAnn.required(); XmlElementHandler handler = new XmlElementHandler(name, ns, nillable, required); XmlElement elem = (XmlElement) Proxy.newProxyInstance(this.getClass().getClassLoader(), new Class<?>[]{XmlElement.class}, handler); jaxb.add(elem); }
/** * Have the builder recognize the type (if it hasn't done so yet), * and returns a {@link NonElement} that represents it. * * @return * always non-null. */ public NonElement<T,C> getTypeInfo(T t,Locatable upstream) { NonElement<T,C> r = typeInfoSet.getTypeInfo(t); if(r!=null) return r; if(nav.isArray(t)) { // no need for checking byte[], because above typeInfoset.getTypeInfo() would return non-null ArrayInfoImpl<T,C,F,M> ai = createArrayInfo(upstream, t); addTypeName(ai); typeInfoSet.add(ai); return ai; } C c = nav.asDecl(t); assert c!=null : t.toString()+" must be a leaf, but we failed to recognize it."; return getClassInfo(c,upstream); }
/** * Have the builder recognize the type (if it hasn't done so yet), * and returns a {@link NonElement} that represents it. * * @return * always non-null. */ public NonElement<T,C> getTypeInfo(T t,Locatable upstream) { NonElement<T,C> r = typeInfoSet.getTypeInfo(t); if(r!=null) return r; if(nav.isArray(t)) { // no need for checking byte[], because above typeInfoset.getTypeInfo() would return non-null ArrayInfoImpl<T,C,F,M> ai = createArrayInfo(upstream, t); addTypeName(ai); typeInfoSet.add(ai); return ai; } C c = nav.asDecl(t); assert c!=null : t.toString()+" must be a leaf, but we failed to recognize it."; return getClassInfo(c,upstream); }