Java Code Examples for com.sun.xml.internal.ws.util.xml.XmlUtil#getPrefix()

The following examples show how to use com.sun.xml.internal.ws.util.xml.XmlUtil#getPrefix() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WSEndpointReference.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
private QName getElementTextAsQName(StreamReaderBufferProcessor xsr) throws XMLStreamException {
    String text = xsr.getElementText().trim();
    String prefix = XmlUtil.getPrefix(text);
    String name = XmlUtil.getLocalPart(text);
    if (name != null) {
        if (prefix != null) {
            String ns = xsr.getNamespaceURI(prefix);
            if (ns != null) {
                return new QName(ns, name, prefix);
            }
        } else {
            return new QName(null, name);
        }
    }
    return null;
}
 
Example 2
Source File: WSEndpointReference.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
private QName getElementTextAsQName(StreamReaderBufferProcessor xsr) throws XMLStreamException {
    String text = xsr.getElementText().trim();
    String prefix = XmlUtil.getPrefix(text);
    String name = XmlUtil.getLocalPart(text);
    if (name != null) {
        if (prefix != null) {
            String ns = xsr.getNamespaceURI(prefix);
            if (ns != null) {
                return new QName(ns, name, prefix);
            }
        } else {
            return new QName(null, name);
        }
    }
    return null;
}
 
Example 3
Source File: TWSDLParserContextImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public void registerNamespaces(Element e) {
    for (Iterator iter = XmlUtil.getAllAttributes(e); iter.hasNext();) {
        Attr a = (Attr) iter.next();
        if (a.getName().equals(PREFIX_XMLNS)) {
            // default namespace declaration
            _nsSupport.declarePrefix("", a.getValue());
        } else {
            String prefix = XmlUtil.getPrefix(a.getName());
            if (prefix != null && prefix.equals(PREFIX_XMLNS)) {
                String nsPrefix = XmlUtil.getLocalPart(a.getName());
                String uri = a.getValue();
                _nsSupport.declarePrefix(nsPrefix, uri);
            }
        }
    }
}
 
Example 4
Source File: TWSDLParserContextImpl.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public QName translateQualifiedName(Locator locator, String s) {
    if (s == null)
        return null;

    String prefix = XmlUtil.getPrefix(s);
    String uri = null;

    if (prefix == null) {
        uri = getDefaultNamespaceURI();
    } else {
        uri = getNamespaceURI(prefix);
        if (uri == null) {
            errorReceiver.error(locator, WsdlMessages.PARSING_UNKNOWN_NAMESPACE_PREFIX(prefix));
        }
    }

    return new QName(uri, XmlUtil.getLocalPart(s));
}
 
Example 5
Source File: TWSDLParserContextImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public QName translateQualifiedName(Locator locator, String s) {
    if (s == null)
        return null;

    String prefix = XmlUtil.getPrefix(s);
    String uri = null;

    if (prefix == null) {
        uri = getDefaultNamespaceURI();
    } else {
        uri = getNamespaceURI(prefix);
        if (uri == null) {
            errorReceiver.error(locator, WsdlMessages.PARSING_UNKNOWN_NAMESPACE_PREFIX(prefix));
        }
    }

    return new QName(uri, XmlUtil.getLocalPart(s));
}
 
Example 6
Source File: TWSDLParserContextImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public void registerNamespaces(Element e) {
    for (Iterator iter = XmlUtil.getAllAttributes(e); iter.hasNext();) {
        Attr a = (Attr) iter.next();
        if (a.getName().equals(PREFIX_XMLNS)) {
            // default namespace declaration
            _nsSupport.declarePrefix("", a.getValue());
        } else {
            String prefix = XmlUtil.getPrefix(a.getName());
            if (prefix != null && prefix.equals(PREFIX_XMLNS)) {
                String nsPrefix = XmlUtil.getLocalPart(a.getName());
                String uri = a.getValue();
                _nsSupport.declarePrefix(nsPrefix, uri);
            }
        }
    }
}
 
Example 7
Source File: WSEndpointReference.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
private QName getElementTextAsQName(StreamReaderBufferProcessor xsr) throws XMLStreamException {
    String text = xsr.getElementText().trim();
    String prefix = XmlUtil.getPrefix(text);
    String name = XmlUtil.getLocalPart(text);
    if (name != null) {
        if (prefix != null) {
            String ns = xsr.getNamespaceURI(prefix);
            if (ns != null) {
                return new QName(ns, name, prefix);
            }
        } else {
            return new QName(null, name);
        }
    }
    return null;
}
 
Example 8
Source File: WSEndpointReference.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
private QName getElementTextAsQName(StreamReaderBufferProcessor xsr) throws XMLStreamException {
    String text = xsr.getElementText().trim();
    String prefix = XmlUtil.getPrefix(text);
    String name = XmlUtil.getLocalPart(text);
    if (name != null) {
        if (prefix != null) {
            String ns = xsr.getNamespaceURI(prefix);
            if (ns != null) {
                return new QName(ns, name, prefix);
            }
        } else {
            return new QName(null, name);
        }
    }
    return null;
}
 
Example 9
Source File: WSEndpointReference.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
private QName getElementTextAsQName(StreamReaderBufferProcessor xsr) throws XMLStreamException {
    String text = xsr.getElementText().trim();
    String prefix = XmlUtil.getPrefix(text);
    String name = XmlUtil.getLocalPart(text);
    if (name != null) {
        if (prefix != null) {
            String ns = xsr.getNamespaceURI(prefix);
            if (ns != null) {
                return new QName(ns, name, prefix);
            }
        } else {
            return new QName(null, name);
        }
    }
    return null;
}
 
Example 10
Source File: TWSDLParserContextImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public QName translateQualifiedName(Locator locator, String s) {
    if (s == null)
        return null;

    String prefix = XmlUtil.getPrefix(s);
    String uri = null;

    if (prefix == null) {
        uri = getDefaultNamespaceURI();
    } else {
        uri = getNamespaceURI(prefix);
        if (uri == null) {
            errorReceiver.error(locator, WsdlMessages.PARSING_UNKNOWN_NAMESPACE_PREFIX(prefix));
        }
    }

    return new QName(uri, XmlUtil.getLocalPart(s));
}
 
Example 11
Source File: TWSDLParserContextImpl.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public QName translateQualifiedName(Locator locator, String s) {
    if (s == null)
        return null;

    String prefix = XmlUtil.getPrefix(s);
    String uri = null;

    if (prefix == null) {
        uri = getDefaultNamespaceURI();
    } else {
        uri = getNamespaceURI(prefix);
        if (uri == null) {
            errorReceiver.error(locator, WsdlMessages.PARSING_UNKNOWN_NAMESPACE_PREFIX(prefix));
        }
    }

    return new QName(uri, XmlUtil.getLocalPart(s));
}
 
Example 12
Source File: TWSDLParserContextImpl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public void registerNamespaces(Element e) {
    for (Iterator iter = XmlUtil.getAllAttributes(e); iter.hasNext();) {
        Attr a = (Attr) iter.next();
        if (a.getName().equals(PREFIX_XMLNS)) {
            // default namespace declaration
            _nsSupport.declarePrefix("", a.getValue());
        } else {
            String prefix = XmlUtil.getPrefix(a.getName());
            if (prefix != null && prefix.equals(PREFIX_XMLNS)) {
                String nsPrefix = XmlUtil.getLocalPart(a.getName());
                String uri = a.getValue();
                _nsSupport.declarePrefix(nsPrefix, uri);
            }
        }
    }
}
 
Example 13
Source File: TWSDLParserContextImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public QName translateQualifiedName(Locator locator, String s) {
    if (s == null)
        return null;

    String prefix = XmlUtil.getPrefix(s);
    String uri = null;

    if (prefix == null) {
        uri = getDefaultNamespaceURI();
    } else {
        uri = getNamespaceURI(prefix);
        if (uri == null) {
            errorReceiver.error(locator, WsdlMessages.PARSING_UNKNOWN_NAMESPACE_PREFIX(prefix));
        }
    }

    return new QName(uri, XmlUtil.getLocalPart(s));
}
 
Example 14
Source File: TWSDLParserContextImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public void registerNamespaces(Element e) {
    for (Iterator iter = XmlUtil.getAllAttributes(e); iter.hasNext();) {
        Attr a = (Attr) iter.next();
        if (a.getName().equals(PREFIX_XMLNS)) {
            // default namespace declaration
            _nsSupport.declarePrefix("", a.getValue());
        } else {
            String prefix = XmlUtil.getPrefix(a.getName());
            if (prefix != null && prefix.equals(PREFIX_XMLNS)) {
                String nsPrefix = XmlUtil.getLocalPart(a.getName());
                String uri = a.getValue();
                _nsSupport.declarePrefix(nsPrefix, uri);
            }
        }
    }
}
 
Example 15
Source File: ParserUtil.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public static QName getQName(XMLStreamReader reader, String tag){
    String localName = XmlUtil.getLocalPart(tag);
    String pfix = XmlUtil.getPrefix(tag);
    String uri = reader.getNamespaceURI(fixNull(pfix));
    return new QName(uri, localName);
}
 
Example 16
Source File: ParserUtil.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public static QName getQName(XMLStreamReader reader, String tag){
    String localName = XmlUtil.getLocalPart(tag);
    String pfix = XmlUtil.getPrefix(tag);
    String uri = reader.getNamespaceURI(fixNull(pfix));
    return new QName(uri, localName);
}
 
Example 17
Source File: ParserUtil.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public static QName getQName(XMLStreamReader reader, String tag){
    String localName = XmlUtil.getLocalPart(tag);
    String pfix = XmlUtil.getPrefix(tag);
    String uri = reader.getNamespaceURI(fixNull(pfix));
    return new QName(uri, localName);
}
 
Example 18
Source File: ParserUtil.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public static QName getQName(XMLStreamReader reader, String tag){
    String localName = XmlUtil.getLocalPart(tag);
    String pfix = XmlUtil.getPrefix(tag);
    String uri = reader.getNamespaceURI(fixNull(pfix));
    return new QName(uri, localName);
}
 
Example 19
Source File: ParserUtil.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public static QName getQName(XMLStreamReader reader, String tag){
    String localName = XmlUtil.getLocalPart(tag);
    String pfix = XmlUtil.getPrefix(tag);
    String uri = reader.getNamespaceURI(fixNull(pfix));
    return new QName(uri, localName);
}
 
Example 20
Source File: ParserUtil.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public static QName getQName(XMLStreamReader reader, String tag){
    String localName = XmlUtil.getLocalPart(tag);
    String pfix = XmlUtil.getPrefix(tag);
    String uri = reader.getNamespaceURI(fixNull(pfix));
    return new QName(uri, localName);
}