Examples of NullPolicy


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 isWriteOnly;

    public XMLCompositeObjectMapping() {
        super();
        // The default policy is NullPolicy
        nullPolicy = new NullPolicy();
    }
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

    private boolean isNormalizingStringValues;
    private AbstractNullPolicy wrapperNullPolicy;

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

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

    private boolean defaultEmptyContainer = XMLContainerMapping.EMPTY_CONTAINER_DEFAULT;

    public XMLCompositeCollectionMapping() {
        super();
        // The default policy is NullPolicy
        nullPolicy = new NullPolicy();
    }
View Full Code Here

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

    private boolean isWriteOnly;

    public XMLCompositeObjectMapping() {
        super();
        // The default policy is NullPolicy
        nullPolicy = new NullPolicy();
    }
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

        sqlTypeMapping.setAttributeName("sqlType");
        sqlTypeMapping.setGetMethodName("getSqlType");
        sqlTypeMapping.setSetMethodName("setSqlType");
        sqlTypeMapping.setXPath(getPrimaryNamespaceXPath() + "@sql-typecode");
        sqlTypeMapping.setNullValue(Integer.valueOf(NULL_SQL_TYPE));
        NullPolicy nullPolicy = new NullPolicy();
        nullPolicy.setNullRepresentedByEmptyNode(false);
        nullPolicy.setNullRepresentedByXsiNil(false);
        nullPolicy.setSetPerformedForAbsentNode(false);
        nullPolicy.setMarshalNullRepresentation(XMLNullRepresentationType.ABSENT_NODE);
        sqlTypeMapping.setNullPolicy(nullPolicy);
        //NULL_SQL_TYPE
        descriptor.addMapping(sqlTypeMapping);

        XMLDirectMapping colDefMapping = new XMLDirectMapping();
View Full Code Here

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

    private boolean isWriteOnly;

    public XMLCompositeObjectMapping() {
        super();
        // The default policy is NullPolicy
        nullPolicy = new NullPolicy();
    }
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.