Examples of resolveNamespaceURI()


Examples of org.eclipse.persistence.internal.oxm.NamespaceResolver.resolveNamespaceURI()

          if(info != null) {
            NamespaceResolver resolver = info.getNamespaceResolverForDescriptor();
           
            String prefix = null;
            if(namespaceUri != Constants.EMPTY_STRING){
                prefix = resolver.resolveNamespaceURI(namespaceUri);
                if(prefix == null){
                  prefix = getPrefixForNamespace(namespaceUri, resolver);             
                }
            }
            desc.setNamespaceResolver(resolver);
View Full Code Here

Examples of org.eclipse.persistence.oxm.NamespaceResolver.resolveNamespaceURI()

      * Add the given namespace uri and prefix to the global namespace resolver.
      */
    public String addNamespace(String prefix, String uri) {
        NamespaceResolver nr = getNamespaceResolver();

        String existingPrefixForURI = nr.resolveNamespaceURI(uri);
        if ((existingPrefixForURI != null) && !existingPrefixForURI.equals("")) {
            //if there is already a prefix for this uri return that one
            return existingPrefixForURI;
        }
        String existingUriForPrefix = nr.resolveNamespacePrefix(prefix);
View Full Code Here

Examples of org.eclipse.persistence.oxm.NamespaceResolver.resolveNamespaceURI()

    public String getPrefix(String uri) {
        if (uri == null) {
            return null;
        }
        NamespaceResolver nr = getNamespaceResolver();
        String existingPrefixForUri = nr.resolveNamespaceURI(uri);
        if ((existingPrefixForUri == null) || existingPrefixForUri.equals("")) {
            //doesn't exist so generate one
            //String newPrefix = nr.generatePrefix();
            String newPrefix = generatePrefix(uri);
            nr.put(newPrefix, uri);
View Full Code Here

Examples of org.eclipse.persistence.oxm.NamespaceResolver.resolveNamespaceURI()

    private void addRootElementToDescriptor(SDOProperty p, String targetNamespace, String xsdName) {
        if (!p.getType().isDataType()) {
            NamespaceResolver nr = ((SDOType) p.getType()).getXmlDescriptor().getNamespaceResolver();
            String prefix = null;
            if (nr != null) {
                prefix = nr.resolveNamespaceURI(targetNamespace);
            }
            if ((prefix == null) || prefix.equals(SDOConstants.EMPTY_STRING)) {
                ((SDOType) p.getType()).getXmlDescriptor().addRootElement(xsdName);
            } else {
                ((SDOType) p.getType()).getXmlDescriptor().addRootElement(prefix + //
View Full Code Here

Examples of org.eclipse.persistence.oxm.NamespaceResolver.resolveNamespaceURI()

            String rootElementName = this.marshalledObjectRootQName.getLocalPart();
            String rootNamespaceUri = this.marshalledObjectRootQName.getNamespaceURI();
            if(rootNamespaceUri != null && !rootNamespaceUri.equals("")) {
                NamespaceResolver resolver = getRootMarshalRecord().getNamespaceResolver();
                if(resolver != null) {
                    String prefix = resolver.resolveNamespaceURI(this.marshalledObjectRootQName.getNamespaceURI());
                    if(prefix != null) {
                        rootElementName = prefix + ":" + rootElementName;
                    }
                }
            }
View Full Code Here

Examples of org.eclipse.persistence.oxm.NamespaceResolver.resolveNamespaceURI()

    }
   
    private boolean declareNamespace(String uri, String prefix, DataObject theDataObject) {
        while (theDataObject != null) {
            NamespaceResolver nr = ((SDOType)theDataObject.getType()).getXmlDescriptor().getNonNullNamespaceResolver();
            String resolvedPrefix = nr.resolveNamespaceURI(uri);
            if ((resolvedPrefix != null) && !resolvedPrefix.equals("") && resolvedPrefix.equals(prefix)) {
                return false;
            }
            theDataObject = theDataObject.getContainer();
        }
View Full Code Here

Examples of org.eclipse.persistence.oxm.NamespaceResolver.resolveNamespaceURI()

                            String xsiPrefix = null;
                            if (null == namespaceResolver) {
                                namespaceResolver = new NamespaceResolver();
                                xmlDescriptor.setNamespaceResolver(namespaceResolver);
                            } else {
                                xsiPrefix = namespaceResolver.resolveNamespaceURI(XMLConstants.SCHEMA_INSTANCE_URL);
                            }

                            if (null == xsiPrefix) {
                                xsiPrefix = namespaceResolver.generatePrefix(XMLConstants.SCHEMA_INSTANCE_PREFIX);
                            }
View Full Code Here

Examples of org.eclipse.persistence.oxm.NamespaceResolver.resolveNamespaceURI()

            marshalRecord.setLeafElementType(root.getSchemaType());
        }

        String xsiPrefix = null;
        if ((null != getSchemaLocation()) || (null != getNoNamespaceSchemaLocation()) || shouldWriteTypeAttribute) {
            xsiPrefix = nr.resolveNamespaceURI(XMLConstants.SCHEMA_INSTANCE_URL);
            if (null == xsiPrefix) {
                xsiPrefix = XMLConstants.SCHEMA_INSTANCE_PREFIX;
                nr.put(XMLConstants.SCHEMA_INSTANCE_PREFIX, XMLConstants.SCHEMA_INSTANCE_URL);
            }
        }
View Full Code Here

Examples of org.eclipse.persistence.oxm.NamespaceResolver.resolveNamespaceURI()

            String xmlRootUri = ((XMLRoot) object).getNamespaceURI();
            String xmlRootPrefix = null;
            if (xmlRow == null) {
                String recordName = ((XMLRoot) object).getLocalName();
                if (xmlRootUri != null) {
                    xmlRootPrefix = resolver.resolveNamespaceURI(xmlRootUri);
                    if (xmlRootPrefix == null && !(xmlRootUri.equals(resolver.getDefaultNamespaceURI()))) {
                        xmlRootPrefix = resolver.generatePrefix();
                        resolver.put(xmlRootPrefix, xmlRootUri);
                        shouldCallSetAttributeNS = true;
                    }
View Full Code Here

Examples of org.eclipse.persistence.oxm.NamespaceResolver.resolveNamespaceURI()

                QName attributeName = (QName) key;
                String namespaceURI = attributeName.getNamespaceURI();
                String qualifiedName = attributeName.getLocalPart();

                if (nr != null) {
                    String prefix = nr.resolveNamespaceURI(attributeName.getNamespaceURI());
                    if ((prefix != null) && !prefix.equals("")) {
                        qualifiedName = prefix + ":" + qualifiedName;
                    } else if (attributeName.getNamespaceURI() != null && !attributeName.getNamespaceURI().equals("")) {
                        String generatedPrefix = nr.generatePrefix();
                        qualifiedName = generatedPrefix + ":" + qualifiedName;
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.