private void processXmlNullPolicy(Property property, JavaClass cls, TypeInfo info) { if (propertyHasXmlNullPolicyAnnotation(property)) { setNullPolicyOnProperty(property, helper.getAnnotation(property.getElement(), XmlNullPolicy.class)); } else if (existsExternalMappingWithJavaTypeXmlNullPolicy(info)) { property.setNullPolicy(info.getXmlNullPolicy()); } else if (javaTypeHasXmlNullPolicyAnnotation(cls)) { setNullPolicyOnProperty(property, helper.getAnnotation(cls, XmlNullPolicy.class)); } else if (existsExternaMappingWithPackageXmlNullPolicy(cls)) { property.setNullPolicy(packageToXmlNillableInfoMappings.get(cls.getPackageName()).getXmlNullPolicy()); } else if (helper.isAnnotationPresent(cls.getPackage(), XmlNullPolicy.class)) { setNullPolicyOnProperty(property, helper.getAnnotation(cls.getPackage(), XmlNullPolicy.class)); } else if (helper.isAnnotationPresent(property.getElement(), XmlIsSetNullPolicy.class)) { XmlIsSetNullPolicy nullPolicy = (XmlIsSetNullPolicy) helper.getAnnotation(property.getElement(), XmlIsSetNullPolicy.class); org.eclipse.persistence.jaxb.xmlmodel.XmlIsSetNullPolicy policy = new org.eclipse.persistence.jaxb.xmlmodel.XmlIsSetNullPolicy(); policy.setEmptyNodeRepresentsNull(nullPolicy.emptyNodeRepresentsNull()); policy.setXsiNilRepresentsNull(nullPolicy.xsiNilRepresentsNull()); policy.setNullRepresentationForXml(org.eclipse.persistence.jaxb.xmlmodel.XmlMarshalNullRepresentation.valueOf(nullPolicy.nullRepresentationForXml().toString())); policy.setIsSetMethodName(nullPolicy.isSetMethodName()); for (XmlParameter next : nullPolicy.isSetParameters()) { org.eclipse.persistence.jaxb.xmlmodel.XmlIsSetNullPolicy.IsSetParameter param = new org.eclipse.persistence.jaxb.xmlmodel.XmlIsSetNullPolicy.IsSetParameter(); param.setValue(next.value()); param.setType(next.type().getName()); policy.getIsSetParameter().add(param); } property.setNullPolicy(policy); } }
private void processXmlNullPolicy(Property property, JavaClass cls, TypeInfo info) { if (propertyHasXmlNullPolicyAnnotation(property)) { setNullPolicyOnProperty(property, helper.getAnnotation(property.getElement(), XmlNullPolicy.class)); } else if (existsExternalMappingWithJavaTypeXmlNullPolicy(info)) { property.setNullPolicy(info.getXmlNullPolicy()); } else if (javaTypeHasXmlNullPolicyAnnotation(cls)) { setNullPolicyOnProperty(property, helper.getAnnotation(cls, XmlNullPolicy.class)); } else if (existsExternaMappingWithPackageXmlNullPolicy(cls)) { property.setNullPolicy(packageToXmlNillableInfoMappings.get(cls.getPackageName()).getXmlNullPolicy()); } else if (helper.isAnnotationPresent(cls.getPackage(), XmlNullPolicy.class)) { setNullPolicyOnProperty(property, helper.getAnnotation(cls.getPackage(), XmlNullPolicy.class)); } else if (helper.isAnnotationPresent(property.getElement(), XmlIsSetNullPolicy.class)) { XmlIsSetNullPolicy nullPolicy = (XmlIsSetNullPolicy) helper.getAnnotation(property.getElement(), XmlIsSetNullPolicy.class); org.eclipse.persistence.jaxb.xmlmodel.XmlIsSetNullPolicy policy = new org.eclipse.persistence.jaxb.xmlmodel.XmlIsSetNullPolicy(); policy.setEmptyNodeRepresentsNull(nullPolicy.emptyNodeRepresentsNull()); policy.setXsiNilRepresentsNull(nullPolicy.xsiNilRepresentsNull()); policy.setNullRepresentationForXml(org.eclipse.persistence.jaxb.xmlmodel.XmlMarshalNullRepresentation.valueOf(nullPolicy.nullRepresentationForXml().toString())); policy.setIsSetMethodName(nullPolicy.isSetMethodName()); for (XmlParameter next : nullPolicy.isSetParameters()) { org.eclipse.persistence.jaxb.xmlmodel.XmlIsSetNullPolicy.IsSetParameter param = new org.eclipse.persistence.jaxb.xmlmodel.XmlIsSetNullPolicy.IsSetParameter(); param.setValue(next.value()); param.setType(next.type().getName()); policy.getIsSetParameter().add(param); } property.setNullPolicy(policy); } }