public ERPropertyInfoImpl(ClassInfoImpl<TypeT, ClassDeclT, FieldT, MethodT> classInfo, PropertySeed<TypeT, ClassDeclT, FieldT, MethodT> propertySeed) { super(classInfo, propertySeed); XmlElementWrapper e = seed.readAnnotation(XmlElementWrapper.class); boolean nil = false; boolean required = false; if(!isCollection()) { xmlName = null; if(e!=null) classInfo.builder.reportError(new IllegalAnnotationException( Messages.XML_ELEMENT_WRAPPER_ON_NON_COLLECTION.format( nav().getClassName(parent.getClazz())+'.'+seed.getName()), e )); } else { if(e!=null) { xmlName = calcXmlName(e); nil = e.nillable(); required = e.required(); } else xmlName = null; } wrapperNillable = nil; wrapperRequired = required; }
public MapPropertyInfoImpl(ClassInfoImpl<T,C,F,M> ci, PropertySeed<T,C,F,M> seed) { super(ci, seed); XmlElementWrapper xe = seed.readAnnotation(XmlElementWrapper.class); xmlName = calcXmlName(xe); nil = xe!=null && xe.nillable(); T raw = getRawType(); T bt = nav().getBaseClass(raw, nav().asDecl(Map.class) ); assert bt!=null; // Map property is only for Maps if(nav().isParameterizedType(bt)) { keyType = nav().getTypeArgument(bt,0); valueType = nav().getTypeArgument(bt,1); } else { keyType = valueType = nav().ref(Object.class); } }
JsonInclude.Include _serializationInclusion(Annotated a, JsonInclude.Include defValue) { XmlElementWrapper w = a.getAnnotation(XmlElementWrapper.class); if (w != null) { if (w.nillable()) { return JsonInclude.Include.ALWAYS; } // [jaxb-annotations#52]: Allow specifying inclusion for `nillable=false` too if (_nonNillableInclusion != null) { return _nonNillableInclusion; } } XmlElement e = a.getAnnotation(XmlElement.class); if (e != null) { if (e.nillable()) { return JsonInclude.Include.ALWAYS; } // [jaxb-annotations#52]: Allow specifying inclusion for `nillable=false` too if (_nonNillableInclusion != null) { return _nonNillableInclusion; } } //better pass default value through, if no explicit direction indicating otherwise return defValue; }
public ERPropertyInfoImpl(ClassInfoImpl<TypeT, ClassDeclT, FieldT, MethodT> classInfo, PropertySeed<TypeT, ClassDeclT, FieldT, MethodT> propertySeed) { super(classInfo, propertySeed); XmlElementWrapper e = seed.readAnnotation(XmlElementWrapper.class); boolean nil = false; boolean required = false; if(!isCollection()) { xmlName = null; if(e!=null) classInfo.builder.reportError(new IllegalAnnotationException( Messages.XML_ELEMENT_WRAPPER_ON_NON_COLLECTION.format( nav().getClassName(parent.getClazz())+'.'+seed.getName()), e )); } else { if(e!=null) { xmlName = calcXmlName(e); nil = e.nillable(); required = e.required(); } else xmlName = null; } wrapperNillable = nil; wrapperRequired = required; }
public MapPropertyInfoImpl(ClassInfoImpl<T,C,F,M> ci, PropertySeed<T,C,F,M> seed) { super(ci, seed); XmlElementWrapper xe = seed.readAnnotation(XmlElementWrapper.class); xmlName = calcXmlName(xe); nil = xe!=null && xe.nillable(); T raw = getRawType(); T bt = nav().getBaseClass(raw, nav().asDecl(Map.class) ); assert bt!=null; // Map property is only for Maps if(nav().isParameterizedType(bt)) { keyType = nav().getTypeArgument(bt,0); valueType = nav().getTypeArgument(bt,1); } else { keyType = valueType = nav().ref(Object.class); } }
/** * Whether the wrapper is nillable. * * @return Whether the wrapper is nillable. */ public boolean isWrapperNillable() { boolean nillable = false; XmlElementWrapper xmlElementWrapper = getAnnotation(XmlElementWrapper.class); if (xmlElementWrapper != null) { nillable = xmlElementWrapper.nillable(); } return nillable; }
/** * Whether the wrapper is nillable. * * @return Whether the wrapper is nillable. */ public boolean isWrapperNillable() { boolean nillable = false; XmlElementWrapper xmlElementWrapper = getAnnotation(XmlElementWrapper.class); if (xmlElementWrapper != null) { nillable = xmlElementWrapper.nillable(); } return nillable; }
/** * Whether the wrapper is nillable. * * @return Whether the wrapper is nillable. */ public boolean isWrapperNillable() { boolean nillable = false; XmlElementWrapper xmlElementWrapper = getAnnotation(XmlElementWrapper.class); if (xmlElementWrapper != null) { nillable = xmlElementWrapper.nillable(); } return nillable; }
/** * Whether the wrapper is nillable. * * @return Whether the wrapper is nillable. */ public boolean isWrapperNillable() { boolean nillable = false; XmlElementWrapper xmlElementWrapper = getAnnotation(XmlElementWrapper.class); if (xmlElementWrapper != null) { nillable = xmlElementWrapper.nillable(); } return nillable; }
av0 = fv.visitAnnotation("Ljavax/xml/bind/annotation/XmlElementWrapper;", true); av0.visit("name", el.name()); av0.visit("nillable", el.nillable()); av0.visit("required", el.required()); av0.visit("namespace", el.namespace());
if (w.nillable()) { return JsonInclude.Include.ALWAYS;
if (w.nillable()) { return JsonInclude.Include.ALWAYS;
/** * Implementation of this method is slightly tricky, given that JAXB defaults differ * from Jackson defaults. As of version 1.5 and above, this is resolved by honoring * Jackson defaults (which are configurable), and only using JAXB explicit annotations. */ @Override public JsonInclude.Include findSerializationInclusion(Annotated a, JsonInclude.Include defValue) { XmlElementWrapper w = a.getAnnotation(XmlElementWrapper.class); if (w != null) { if (w.nillable()) { return JsonInclude.Include.ALWAYS; } } XmlElement e = a.getAnnotation(XmlElement.class); if (e != null) { if (e.nillable()) { return JsonInclude.Include.ALWAYS; } } /* [JACKSON-256]: better pass default value through, if no explicit direction indicating * otherwise */ return defValue; }
/** * Implementation of this method is slightly tricky, given that JAXB defaults differ * from Jackson defaults. As of version 1.5 and above, this is resolved by honoring * Jackson defaults (which are configurable), and only using JAXB explicit annotations. */ @Override public JsonInclude.Include findSerializationInclusion(Annotated a, JsonInclude.Include defValue) { XmlElementWrapper w = a.getAnnotation(XmlElementWrapper.class); if (w != null) { if (w.nillable()) { return JsonInclude.Include.ALWAYS; } } XmlElement e = a.getAnnotation(XmlElement.class); if (e != null) { if (e.nillable()) { return JsonInclude.Include.ALWAYS; } } /* [JACKSON-256]: better pass default value through, if no explicit direction indicating * otherwise */ return defValue; }
JsonInclude.Include _serializationInclusion(Annotated a, JsonInclude.Include defValue) { XmlElementWrapper w = a.getAnnotation(XmlElementWrapper.class); if (w != null) { if (w.nillable()) { return JsonInclude.Include.ALWAYS; } // [jaxb-annotations#52]: Allow specifying inclusion for `nillable=false` too if (_nonNillableInclusion != null) { return _nonNillableInclusion; } } XmlElement e = a.getAnnotation(XmlElement.class); if (e != null) { if (e.nillable()) { return JsonInclude.Include.ALWAYS; } // [jaxb-annotations#52]: Allow specifying inclusion for `nillable=false` too if (_nonNillableInclusion != null) { return _nonNillableInclusion; } } //better pass default value through, if no explicit direction indicating otherwise return defValue; }
public ERPropertyInfoImpl(ClassInfoImpl<TypeT, ClassDeclT, FieldT, MethodT> classInfo, PropertySeed<TypeT, ClassDeclT, FieldT, MethodT> propertySeed) { super(classInfo, propertySeed); XmlElementWrapper e = seed.readAnnotation(XmlElementWrapper.class); boolean nil = false; boolean required = false; if(!isCollection()) { xmlName = null; if(e!=null) classInfo.builder.reportError(new IllegalAnnotationException( Messages.XML_ELEMENT_WRAPPER_ON_NON_COLLECTION.format( nav().getClassName(parent.getClazz())+'.'+seed.getName()), e )); } else { if(e!=null) { xmlName = calcXmlName(e); nil = e.nillable(); required = e.required(); } else xmlName = null; } wrapperNillable = nil; wrapperRequired = required; }
public ERPropertyInfoImpl(ClassInfoImpl<TypeT, ClassDeclT, FieldT, MethodT> classInfo, PropertySeed<TypeT, ClassDeclT, FieldT, MethodT> propertySeed) { super(classInfo, propertySeed); XmlElementWrapper e = seed.readAnnotation(XmlElementWrapper.class); boolean nil = false; boolean required = false; if(!isCollection()) { xmlName = null; if(e!=null) classInfo.builder.reportError(new IllegalAnnotationException( Messages.XML_ELEMENT_WRAPPER_ON_NON_COLLECTION.format( nav().getClassName(parent.getClazz())+'.'+seed.getName()), e )); } else { if(e!=null) { xmlName = calcXmlName(e); nil = e.nillable(); required = e.required(); } else xmlName = null; } wrapperNillable = nil; wrapperRequired = required; }
public MapPropertyInfoImpl(ClassInfoImpl<T,C,F,M> ci, PropertySeed<T,C,F,M> seed) { super(ci, seed); XmlElementWrapper xe = seed.readAnnotation(XmlElementWrapper.class); xmlName = calcXmlName(xe); nil = xe!=null && xe.nillable(); T raw = getRawType(); T bt = nav().getBaseClass(raw, nav().asDecl(Map.class) ); assert bt!=null; // Map property is only for Maps if(nav().isParameterizedType(bt)) { keyType = nav().getTypeArgument(bt,0); valueType = nav().getTypeArgument(bt,1); } else { keyType = valueType = nav().ref(Object.class); } }
public MapPropertyInfoImpl(ClassInfoImpl<T,C,F,M> ci, PropertySeed<T,C,F,M> seed) { super(ci, seed); XmlElementWrapper xe = seed.readAnnotation(XmlElementWrapper.class); xmlName = calcXmlName(xe); nil = xe!=null && xe.nillable(); T raw = getRawType(); T bt = nav().getBaseClass(raw, nav().asDecl(Map.class) ); assert bt!=null; // Map property is only for Maps if(nav().isParameterizedType(bt)) { keyType = nav().getTypeArgument(bt,0); valueType = nav().getTypeArgument(bt,1); } else { keyType = valueType = nav().ref(Object.class); } }
av0 = fv.visitAnnotation("Ljavax/xml/bind/annotation/XmlElementWrapper;", true); av0.visit("name", el.name()); av0.visit("nillable", el.nillable()); av0.visit("required", el.required()); av0.visit("namespace", el.namespace());