Examples of resolveNamespaceURI()


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

                // on it, and use it instead.
                // We do this to avoid setting the XOP namespace declaration on
                // a given field or descriptor's resolver, as it is only required
                // on the current element
                if (resolver != null) {
                    prefix = resolver.resolveNamespaceURI(XMLConstants.XOP_URL);
                }
                if (prefix == null) {
                    prefix = XMLConstants.XOP_PREFIX;//"xop";
                    resolver = new NamespaceResolver();
                    resolver.put(prefix, XMLConstants.XOP_URL);
View Full Code Here

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

   
                        //  need a prefix for XOP
                        String prefix = null;
                        NamespaceResolver descriptorResolver = ((XMLDescriptor) getDescriptor()).getNamespaceResolver();
                        if (descriptorResolver != null) {
                            prefix = descriptorResolver.resolveNamespaceURI(XMLConstants.XOP_URL);
                        }
                        if (prefix == null) {
                            prefix = XMLConstants.XOP_PREFIX;
                        }
                        NamespaceResolver tempResolver = new NamespaceResolver();
View Full Code Here

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

                throw XMLMarshalException.namespaceResolverNotSpecified(namespaceURI);
            }
            if(namespaceURI.equals(namespaceResolver.getDefaultNamespaceURI())) {
                return qName.getLocalPart();
            }
            String prefix = namespaceResolver.resolveNamespaceURI(namespaceURI);
            if(null == prefix) {
                prefix = namespaceResolver.generatePrefix();               
                namespaceDeclaration(prefix, namespaceURI);
            }
            if(XMLConstants.EMPTY_STRING.equals(prefix)){
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()

                QName name = (QName) key;
                String value = cp.valueFromKey(key, collection).toString();

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

            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()

                // on it, and use it instead.
                // We do this to avoid setting the XOP namespace declaration on
                // a given field or descriptor's resolver, as it is only required
                // on the current element
                if (resolver != null) {
                    prefix = resolver.resolveNamespaceURI(XMLConstants.XOP_URL);
                }
                if (prefix == null) {
                    prefix = XMLConstants.XOP_PREFIX;//"xop";
                    resolver = new NamespaceResolver();
                    resolver.put(prefix, XMLConstants.XOP_URL);
View Full Code Here

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

                element = include;

                // Need to call setAttributeNS on the record, unless the xop prefix
                // is defined on the descriptor's resolver already
                NamespaceResolver resolver = ((XMLField) getField()).getNamespaceResolver();
                if (resolver == null || resolver.resolveNamespaceURI(XMLConstants.XOP_URL) == null) {
                    resolver = new NamespaceResolver();
                    resolver.put(XMLConstants.XOP_PREFIX, XMLConstants.XOP_URL);
                    String xpath = XMLConstants.XOP_PREFIX + ":" + INCLUDE;
                    XMLField incField = new XMLField(xpath);
                    incField.setNamespaceResolver(resolver);
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.