Package org.eclipse.persistence.internal.oxm.mappings

Examples of org.eclipse.persistence.internal.oxm.mappings.Field.usesSingleNode()


               } else {
                   String valueString = value.toString();
                   if(valueString.length() == 0 && nullPolicy.isNullRepresentedByEmptyNode()){
                       value = null;                  
                   }else{
                     if(field.usesSingleNode()){
                         if(isHex) {
                             value = XMLConversionManager.getDefaultXMLManager().convertHexBinaryListToByteArrayList(valueString, cp, parent.getSession());
                         } else {
                             value = XMLConversionManager.getDefaultXMLManager().convertSchemaBase64ListToByteArrayList(valueString, cp, parent.getSession());
                         }
View Full Code Here


        Field xmlField = (Field) xmlCompositeDirectCollectionMapping.getField();
        if (null != iterator && cp.hasNext(iterator)) {
            XPathFragment groupingFragment = marshalRecord.openStartGroupingElements(namespaceResolver);
            marshalRecord.closeStartGroupingElements(groupingFragment);
        } else {
            if (xmlField.usesSingleNode() && !xmlCompositeDirectCollectionMapping.isDefaultEmptyContainer()) {
                XPathFragment groupingFragment = marshalRecord.openStartGroupingElements(namespaceResolver);
                marshalRecord.closeStartGroupingElements(groupingFragment);
            } else {
                return marshalRecord.emptyCollection(xPathFragment, namespaceResolver, xmlCompositeDirectCollectionMapping.getWrapperNullPolicy() != null);
            }
View Full Code Here

                return marshalRecord.emptyCollection(xPathFragment, namespaceResolver, xmlCompositeDirectCollectionMapping.getWrapperNullPolicy() != null);
            }
        }
       
        Object objectValue;
        if (xmlField.usesSingleNode()) {         
            StringBuilder stringValueStringBuilder = new StringBuilder();
            String newValue;
            QName schemaType = null;
            if (xPathFragment != null && !xPathFragment.isAttribute() && !xPathFragment.nameIsText) {
                marshalRecord.openStartElement(xPathFragment, namespaceResolver);
View Full Code Here

                    type = type.substring(colonIndex + 1);
                }
                unmarshalRecord.setTypeQName(new QName(namespaceURI, type));
            }
        } else if (lastXPathFragment.isAttribute()) {
            if (!xmlField.usesSingleNode()) {
                String namespaceURI = lastXPathFragment.getNamespaceURI();
                if (namespaceURI == null) {
                    namespaceURI = Constants.EMPTY_STRING;
                }
                String value = atts.getValue(namespaceURI, lastXPathFragment.getLocalName());
View Full Code Here

    public void endElement(XPathFragment xPathFragment, UnmarshalRecord unmarshalRecord) {
      Field xmlField = (Field) xmlCompositeDirectCollectionMapping.getField();

      Object value = unmarshalRecord.getCharacters().toString();
      if(((String)value).length() == 0 && !xmlField.usesSingleNode()){
        if( xmlCompositeDirectCollectionMapping.getNullValue() != null){
          value = xmlCompositeDirectCollectionMapping.getNullValue()
        }           
      }
        unmarshalRecord.resetStringBuffer();
View Full Code Here

        XPathFragment lastXPathFragment = xmlField.getLastXPathFragment();
        if (!lastXPathFragment.nameIsText()) {
            return;
        }

        if (xmlField.usesSingleNode()) {
         
            Object collection = unmarshalRecord.getContainerInstance(this);
            StringTokenizer stringTokenizer = new StringTokenizer((String)value);             
            while (stringTokenizer.hasMoreTokens()) {
                addUnmarshalValue(unmarshalRecord, stringTokenizer.nextToken(), collection);
View Full Code Here

    public void endElement(XPathFragment xPathFragment, UnmarshalRecord unmarshalRecord, Object collection) {
        Field xmlField = (Field) xmlCompositeDirectCollectionMapping.getField();
     
      Object value = unmarshalRecord.getCharacters().toString();
      if(((String)value).length() == 0 && !xmlField.usesSingleNode()){
        if( xmlCompositeDirectCollectionMapping.getNullValue() != null){
          value = xmlCompositeDirectCollectionMapping.getNullValue()
        }           
        }
        unmarshalRecord.resetStringBuffer();
View Full Code Here

          value = xmlCompositeDirectCollectionMapping.getNullValue()
        }           
        }
        unmarshalRecord.resetStringBuffer();

        if (xmlField.usesSingleNode() && value instanceof String) {                     
          StringTokenizer stringTokenizer = new StringTokenizer((String)value);
            while (stringTokenizer.hasMoreTokens()) {
                addUnmarshalValue(unmarshalRecord, stringTokenizer.nextToken(), collection);
            }
        } else {           
View Full Code Here

        Field xmlField = (Field) xmlCompositeDirectCollectionMapping.getField();
        if (null != iterator && cp.hasNext(iterator)) {
            XPathFragment groupingFragment = marshalRecord.openStartGroupingElements(namespaceResolver);
            marshalRecord.closeStartGroupingElements(groupingFragment);
        } else {
            if (xmlField.usesSingleNode() && !xmlCompositeDirectCollectionMapping.isDefaultEmptyContainer()) {
                XPathFragment groupingFragment = marshalRecord.openStartGroupingElements(namespaceResolver);
                marshalRecord.closeStartGroupingElements(groupingFragment);
            } else {
                return marshalRecord.emptyCollection(xPathFragment, namespaceResolver, xmlCompositeDirectCollectionMapping.getWrapperNullPolicy() != null);
            }
View Full Code Here

                return marshalRecord.emptyCollection(xPathFragment, namespaceResolver, xmlCompositeDirectCollectionMapping.getWrapperNullPolicy() != null);
            }
        }
       
        Object objectValue;
        if (xmlField.usesSingleNode()) {         
            StringBuilder stringValueStringBuilder = new StringBuilder();
            String newValue;
            QName schemaType = null;
            if (xPathFragment != null && !xPathFragment.isAttribute() && !xPathFragment.nameIsText) {
                marshalRecord.openStartElement(xPathFragment, namespaceResolver);
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.