Examples of XPathNode


Examples of org.eclipse.persistence.internal.oxm.XPathNode

            }

            return;
        }

        XPathNode childNode = null;
        XPathNodeWrapper newNodeWrapper = null;

        // find our child node
        final XPathNodeWrapper currentNodeWrapper = getCurrentNodeWrapper();
        final XPathNodeWrapper actualNodeWrapper = currentNodeWrapper.currentType == null ? currentNodeWrapper : currentNodeWrapper.currentType;

        final Map<XPathFragment, XPathNode> nonAttributeChildrenMap =
                actualNodeWrapper == null ? null : actualNodeWrapper.xPathNode.getNonAttributeChildrenMap();

        if (nonAttributeChildrenMap != null) {
            for (Map.Entry<XPathFragment, XPathNode> child : nonAttributeChildrenMap.entrySet()) {
                if (name.getLocalPart().equalsIgnoreCase(child.getKey().getLocalName())) {
                    childNode = child.getValue();
                    break;
                }
            }

            if (childNode != null) {
                final MappingNodeValue nodeValue = (MappingNodeValue) childNode.getNodeValue();

                if (nodeValue != null) {
                    ClassDescriptor descriptor = nodeValue.getMapping().getReferenceDescriptor();

                    if (descriptor == null && !isReader) {
View Full Code Here

Examples of org.eclipse.persistence.internal.oxm.XPathNode

            if (null != xPathNode.getSelfChildren()) {
                int selfChildrenSize = xPathNode.getSelfChildren().size();
                selfRecords = new ArrayList<UnmarshalRecord>(selfChildrenSize);
                for (int x = 0; x < selfChildrenSize; x++) {
                    XPathNode selfNode = xPathNode.getSelfChildren().get(x);
                    if (null != selfNode.getNodeValue()) {
                        selfRecords.add(selfNode.getNodeValue().buildSelfRecord(this, attributes));
                    }
                }
            }
        } catch (EclipseLinkException e) {
            if (null == xmlReader.getErrorHandler()) {
View Full Code Here

Examples of org.eclipse.persistence.internal.oxm.XPathNode

        }

        if (null != xPathNode.getSelfChildren()) {
            int selfChildrenSize = xPathNode.getSelfChildren().size();
            for (int x = 0; x < selfChildrenSize; x++) {
                XPathNode selfNode = xPathNode.getSelfChildren().get(x);
                if (null != selfNode.getNodeValue()) {
                    selfNode.getNodeValue().endSelfNodeValue(this, selfRecords.get(x), attributes);
                }
            }
        }

        try {
View Full Code Here

Examples of org.eclipse.persistence.internal.oxm.XPathNode

            if(unmappedLevel != -1 && unmappedLevel <= levelIndex) {
                levelIndex++;
                return;
            }

            XPathNode node = getNonAttributeXPathNode(namespaceURI, localName, qName, atts);
            if (null == node) {
                NodeValue parentNodeValue = xPathNode.getUnmarshalNodeValue();
                if ((null == xPathNode.getXPathFragment()) && (parentNodeValue != null)) {
                    XPathFragment parentFragment = new XPathFragment();
                    if(namespaceURI != null && namespaceURI.length() == 0){
                        parentFragment.setLocalName(qName);
                        parentFragment.setNamespaceURI(null);
                    } else {
                        parentFragment.setLocalName(localName);
                        parentFragment.setNamespaceURI(namespaceURI);
                    }
                    if (parentNodeValue.startElement(parentFragment, this, atts)) {
                        levelIndex++;
                    } else {
                        // UNMAPPED CONTENT
                        startUnmappedElement(namespaceURI, localName, qName, atts);
                        return;
                    }
                } else {
                    // UNMAPPED CONTENT
                    levelIndex++;
                    startUnmappedElement(namespaceURI, localName, qName, atts);
                    return;
                }
            } else {
                xPathNode = node;
                unmarshalContext.startElement(this);
                levelIndex++;

                isXsiNil = atts.getIndex(XMLConstants.SCHEMA_INSTANCE_URL, XMLConstants.SCHEMA_NIL_ATTRIBUTE) >= 0;
                NodeValue nodeValue = node.getUnmarshalNodeValue();
                if (null != nodeValue) {
                    if (!nodeValue.startElement(xPathFragment, this, atts)) {
                        // UNMAPPED CONTENT
                        startUnmappedElement(namespaceURI, localName, qName, atts);
                        return;
View Full Code Here

Examples of org.eclipse.persistence.internal.oxm.XPathNode

                return;
            }
            if (null != xPathNode.getUnmarshalNodeValue()) {
                xPathNode.getUnmarshalNodeValue().endElement(xPathFragment, this);
            } else {
                XPathNode textNode = xPathNode.getTextNode();

                if (null != textNode && textNode.isWhitespaceAware() && getStringBuffer().length() == 0) {
                    NodeValue textNodeUnmarshalNodeValue = textNode.getUnmarshalNodeValue();
                    if (!isXsiNil) {
                        if (textNodeUnmarshalNodeValue.isMappingNodeValue()) {
                            textNodeUnmarshalNodeValue.endElement(xPathFragment, this);
                        }
                    } else {
View Full Code Here

Examples of org.eclipse.persistence.internal.oxm.XPathNode

                }
            }
            if(-1 != unmappedLevel && unmappedLevel <= levelIndex) {
                return;
            }
            XPathNode textNode = xPathNode.getTextNode();
            if (null == textNode) {
                textNode = xPathNode.getAnyNode();
                if (textNode != null) {
                    xpathNodeIsMixedContent = true;
                    this.xPathFragment.setLocalName(null);
                    this.xPathFragment.setNamespaceURI(null);
                    if (0 == length) {
                        return;
                    }
                    String tmpString = new String(ch, start, length);
                    if (!textNode.isWhitespaceAware() && tmpString.trim().length() == 0) {
                        return;
                    }
                }
            }
View Full Code Here

Examples of org.eclipse.persistence.internal.oxm.XPathNode

        } else {
            xPathFragment.setLocalName(localName);
            xPathFragment.setNamespaceURI(namespaceURI);
        }

        XPathNode resultNode = null;
        Map nonAttributeChildrenMap = xPathNode.getNonAttributeChildrenMap();
        if (null != nonAttributeChildrenMap) {
            resultNode = (XPathNode)nonAttributeChildrenMap.get(xPathFragment);
            if (null == resultNode) {
                // POSITIONAL MAPPING
View Full Code Here

Examples of org.eclipse.persistence.internal.oxm.XPathNode

            if(namespace != null && namespace.length() == 0){
                xPathFragment.setNamespaceURI(null);
            } else {
                xPathFragment.setNamespaceURI(namespace);
            }
            XPathNode node = (XPathNode)attributeChildrenMap.get(xPathFragment);
            if (node != null) {
                return node.getUnmarshalNodeValue();
            }
        }
        return null;
    }
View Full Code Here

Examples of org.eclipse.persistence.internal.oxm.XPathNode

        if (null == groupingElements) {
            return null;
        }
        XPathFragment xPathFragment = null;
        for (int x = 0, groupingElementsSize = groupingElements.size(); x < groupingElementsSize; x++) {
            XPathNode xPathNode = groupingElements.get(x);
            xPathFragment = xPathNode.getXPathFragment();
            openStartElement(xPathFragment, namespaceResolver);

            predicateAttribute(xPathFragment, namespaceResolver);

            if (x != (groupingElementsSize - 1)) {
View Full Code Here

Examples of org.eclipse.persistence.internal.oxm.XPathNode

                return;
            }
        }

        // get the parent above the text() node     
        XPathNode parentNode = xPathNode.getParent();

        // isset nillable only       
        if (isNullRepresentedByXsiNil() || getMarshalNullRepresentation().equals(XMLNullRepresentationType.XSI_NIL)) {
            XPathFragment xPathFragment = new XPathFragment();
            xPathFragment.setXPath('@' + XMLConstants.SCHEMA_NIL_ATTRIBUTE);
            xPathFragment.setNamespaceURI(XMLConstants.SCHEMA_INSTANCE_URL);
            NodeValue aNodeValue = new NillableNodeValue(nullCapableValue);
            parentNode.addChild(xPathFragment, aNodeValue, null);
        } else {
            NodeValue aNodeValue = new OptionalNodeValue(nullCapableValue);
            parentNode.setNodeValue(aNodeValue);
        }
    }
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.