Examples of NullPolicy


Examples of org.eclipse.persistence.oxm.mappings.nullpolicy.NullPolicy

        mapping.setXPath(getXPathForField(property, namespaceInfo, false, false).getXPath());
        // handle null policy set via xml metadata
        if (property.isSetNullPolicy()) {
            mapping.setNullPolicy(getNullPolicyFromProperty(property, namespaceInfo.getNamespaceResolverForDescriptor()));
        } else {
            NullPolicy nullPolicy = (NullPolicy) mapping.getNullPolicy();
            nullPolicy.setSetPerformedForAbsentNode(false);
            if(property.isNillable()) {
                nullPolicy.setNullRepresentedByXsiNil(true);
                nullPolicy.setMarshalNullRepresentation(XMLNullRepresentationType.XSI_NIL);
            }
        }

        if (referenceClassName == null){
          setTypedTextField((XMLField)mapping.getField());
View Full Code Here

Examples of org.eclipse.persistence.oxm.mappings.nullpolicy.NullPolicy

        valueClassName = valueClass;
      }
  }

    private AbstractNullPolicy getWrapperNullPolicyFromProperty(Property property) {
        NullPolicy nullPolicy = null;

        if (property.isSetXmlElementWrapper()) {
            nullPolicy = new NullPolicy();
            nullPolicy.setNullRepresentedByEmptyNode(false);
            nullPolicy.setSetPerformedForAbsentNode(false);

            if (property.getXmlElementWrapper().isNillable()) {
                nullPolicy.setMarshalNullRepresentation(XMLNullRepresentationType.XSI_NIL);
                nullPolicy.setNullRepresentedByXsiNil(true);
            } else {
                nullPolicy.setMarshalNullRepresentation(XMLNullRepresentationType.ABSENT_NODE);
                nullPolicy.setNullRepresentedByXsiNil(false);
            }
        }

        return nullPolicy;
    }
View Full Code Here

Examples of org.eclipse.persistence.oxm.mappings.nullpolicy.NullPolicy

        XmlAbstractNullPolicy xmlAbsNullPolicy = property.getNullPolicy();

        // policy is assumed to be one of XmlNullPolicy or XmlIsSetNullPolicy
        if (xmlAbsNullPolicy instanceof XmlNullPolicy) {
            XmlNullPolicy xmlNullPolicy = (XmlNullPolicy) xmlAbsNullPolicy;
            NullPolicy nullPolicy = new NullPolicy();
            nullPolicy.setSetPerformedForAbsentNode(xmlNullPolicy.isIsSetPerformedForAbsentNode());
            absNullPolicy = nullPolicy;
        } else {
            XmlIsSetNullPolicy xmlIsSetNullPolicy = (XmlIsSetNullPolicy) xmlAbsNullPolicy;
            IsSetNullPolicy isSetNullPolicy = new IsSetNullPolicy();
            isSetNullPolicy.setIsSetMethodName(xmlIsSetNullPolicy.getIsSetMethodName());
View Full Code Here

Examples of org.eclipse.persistence.oxm.mappings.nullpolicy.NullPolicy

        defaultRootElementFieldMapping.setAttributeName("defaultRootElementField");
        defaultRootElementFieldMapping.setGetMethodName("getDefaultRootElementField");
        defaultRootElementFieldMapping.setSetMethodName("setDefaultRootElementField");
        defaultRootElementFieldMapping.setXPath(getPrimaryNamespaceXPath() + "default-root-element-field");
        defaultRootElementFieldMapping.setReferenceClass(XMLField.class);
        NullPolicy defaultRootElementFieldNullPolicy = new NullPolicy();
        defaultRootElementFieldNullPolicy.setSetPerformedForAbsentNode(false);
        defaultRootElementFieldMapping.setNullPolicy(defaultRootElementFieldNullPolicy);
        /* order is important for writing out
         * don't use addMapping: set parent descriptor and add after
         * first mapping built in super.buildOXXMLDescriptorDescriptor()
         */
 
View Full Code Here

Examples of org.eclipse.persistence.oxm.mappings.nullpolicy.NullPolicy

         @Override
         public Object getAttributeValueFromObject(Object object) throws DescriptorException {
            // If the policy is default (NullPolicy(ispfan=true, inrben=false, inrbxnn=false, XMLNullRep=ABSENT_NODE) return null
            AbstractNullPolicy value = ((XMLNillableMapping)object).getNullPolicy();
            if(value instanceof NullPolicy) {
                NullPolicy aPolicy = (NullPolicy)value;
                if(aPolicy.getIsSetPerformedForAbsentNode() && !aPolicy.isNullRepresentedByEmptyNode() //
                    && !aPolicy.isNullRepresentedByXsiNil() //
                    && aPolicy.getMarshalNullRepresentation().equals(XMLNullRepresentationType.ABSENT_NODE)) {
                  // The default policy is represented by null
                  return null;
                }
            }
            return ((XMLNillableMapping)object).getNullPolicy();
View Full Code Here

Examples of org.eclipse.persistence.oxm.mappings.nullpolicy.NullPolicy

         @Override
         public void setAttributeValueInObject(Object object, Object value) throws DescriptorException {
           // If value is a default policy represented by null - return (NullPolicy(ispfan=true, inrben=false, inrbxn=false, XMLNullRep=ABSENT_NODE)
            if(null == value) {
              // Create and set a default policy
              ((XMLNillableMapping)object).setNullPolicy(new NullPolicy());
            } else {
              // Set the value as policy
                ((XMLNillableMapping)object).setNullPolicy((AbstractNullPolicy)value);
            }
         }
View Full Code Here

Examples of org.eclipse.persistence.oxm.mappings.nullpolicy.NullPolicy

    private AbstractNullPolicy nullPolicy;
    protected boolean reuseContainer;

    public XMLCompositeDirectCollectionMapping() {
        super();
        this.nullPolicy = new NullPolicy();
        this.nullPolicy.setNullRepresentedByEmptyNode(true);
    }
View Full Code Here

Examples of org.eclipse.persistence.oxm.mappings.nullpolicy.NullPolicy

         @Override
         public Object getAttributeValueFromObject(Object object) throws DescriptorException {
            // If the policy is default (NullPolicy(ispfan=true, inrben=false, inrbxnn=false, XMLNullRep=ABSENT_NODE) return null
            AbstractNullPolicy value = ((XMLNillableMapping)object).getNullPolicy();
            if(value instanceof NullPolicy) {
                NullPolicy aPolicy = (NullPolicy)value;
                if(aPolicy.getIsSetPerformedForAbsentNode() && !aPolicy.isNullRepresentedByEmptyNode() //
                    && !aPolicy.isNullRepresentedByXsiNil() //
                    && aPolicy.getMarshalNullRepresentation().equals(XMLNullRepresentationType.ABSENT_NODE)) {
                  // The default policy is represented by null
                  return null;
                }
            }
            return ((XMLNillableMapping)object).getNullPolicy();
View Full Code Here

Examples of org.eclipse.persistence.oxm.mappings.nullpolicy.NullPolicy

         @Override
         public void setAttributeValueInObject(Object object, Object value) throws DescriptorException {
           // If value is a default policy represented by null - return (NullPolicy(ispfan=true, inrben=false, inrbxn=false, XMLNullRep=ABSENT_NODE)
            if(null == value) {
              // Create and set a default policy
              ((XMLNillableMapping)object).setNullPolicy(new NullPolicy());
            } else {
              // Set the value as policy
                ((XMLNillableMapping)object).setNullPolicy((AbstractNullPolicy)value);
            }
         }
View Full Code Here

Examples of org.eclipse.persistence.oxm.mappings.nullpolicy.NullPolicy

    private boolean isNormalizingStringValues;
    private AbstractNullPolicy wrapperNullPolicy;

    public XMLCompositeDirectCollectionMapping() {
        super();
        this.nullPolicy = new NullPolicy();
        this.nullPolicy.setNullRepresentedByEmptyNode(true);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.