com.sun.xml.internal.bind.util.Which Java Examples

The following examples show how to use com.sun.xml.internal.bind.util.Which. 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: SAX2DOMEx.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void startElement(String namespace, String localName, String qName, Attributes attrs) {
    Node parent = nodeStack.peek();

    // some broken DOM implementation (we confirmed it with SAXON)
    // return null from this method.
    Element element = document.createElementNS(namespace, qName);

    if (element == null) {
        // if so, report an user-friendly error message,
        // rather than dying mysteriously with NPE.
        throw new AssertionError(
                Messages.format(Messages.DOM_IMPL_DOESNT_SUPPORT_CREATELEMENTNS,
                document.getClass().getName(),
                Which.which(document.getClass())));
    }

    // process namespace bindings
    for (int i = 0; i < unprocessedNamespaces.size(); i += 2) {
        String prefix = unprocessedNamespaces.get(i);
        String uri = unprocessedNamespaces.get(i + 1);

        namespace(element, prefix, uri);
    }
    unprocessedNamespaces.clear();


    if (attrs != null) {
        int length = attrs.getLength();
        for (int i = 0; i < length; i++) {
            String namespaceuri = attrs.getURI(i);
            String value = attrs.getValue(i);
            String qname = attrs.getQName(i);
            element.setAttributeNS(namespaceuri, qname, value);
        }
    }
    // append this new node onto current stack node
    parent.appendChild(element);
    // push this node onto stack
    nodeStack.push(element);
}
 
Example #2
Source File: JAXBContextImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public String toString() {
    StringBuilder buf = new StringBuilder(Which.which(getClass()) + " Build-Id: " + getBuildId());
    buf.append("\nClasses known to this context:\n");

    Set<String> names = new TreeSet<String>();  // sort them so that it's easy to read

    for (Class key : beanInfoMap.keySet())
        names.add(key.getName());

    for(String name: names)
        buf.append("  ").append(name).append('\n');

    return buf.toString();
}
 
Example #3
Source File: SAX2DOMEx.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void startElement(String namespace, String localName, String qName, Attributes attrs) {
    Node parent = nodeStack.peek();

    // some broken DOM implementation (we confirmed it with SAXON)
    // return null from this method.
    Element element = document.createElementNS(namespace, qName);

    if (element == null) {
        // if so, report an user-friendly error message,
        // rather than dying mysteriously with NPE.
        throw new AssertionError(
                Messages.format(Messages.DOM_IMPL_DOESNT_SUPPORT_CREATELEMENTNS,
                document.getClass().getName(),
                Which.which(document.getClass())));
    }

    // process namespace bindings
    for (int i = 0; i < unprocessedNamespaces.size(); i += 2) {
        String prefix = unprocessedNamespaces.get(i);
        String uri = unprocessedNamespaces.get(i + 1);

        namespace(element, prefix, uri);
    }
    unprocessedNamespaces.clear();


    if (attrs != null) {
        int length = attrs.getLength();
        for (int i = 0; i < length; i++) {
            String namespaceuri = attrs.getURI(i);
            String value = attrs.getValue(i);
            String qname = attrs.getQName(i);
            element.setAttributeNS(namespaceuri, qname, value);
        }
    }
    // append this new node onto current stack node
    parent.appendChild(element);
    // push this node onto stack
    nodeStack.push(element);
}
 
Example #4
Source File: JAXBContextImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public String toString() {
    StringBuilder buf = new StringBuilder(Which.which(getClass()) + " Build-Id: " + getBuildId());
    buf.append("\nClasses known to this context:\n");

    Set<String> names = new TreeSet<String>();  // sort them so that it's easy to read

    for (Class key : beanInfoMap.keySet())
        names.add(key.getName());

    for(String name: names)
        buf.append("  ").append(name).append('\n');

    return buf.toString();
}
 
Example #5
Source File: SAX2DOMEx.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void startElement(String namespace, String localName, String qName, Attributes attrs) {
    Node parent = nodeStack.peek();

    // some broken DOM implementation (we confirmed it with SAXON)
    // return null from this method.
    Element element = document.createElementNS(namespace, qName);

    if (element == null) {
        // if so, report an user-friendly error message,
        // rather than dying mysteriously with NPE.
        throw new AssertionError(
                Messages.format(Messages.DOM_IMPL_DOESNT_SUPPORT_CREATELEMENTNS,
                document.getClass().getName(),
                Which.which(document.getClass())));
    }

    // process namespace bindings
    for (int i = 0; i < unprocessedNamespaces.size(); i += 2) {
        String prefix = unprocessedNamespaces.get(i);
        String uri = unprocessedNamespaces.get(i + 1);

        namespace(element, prefix, uri);
    }
    unprocessedNamespaces.clear();


    if (attrs != null) {
        int length = attrs.getLength();
        for (int i = 0; i < length; i++) {
            String namespaceuri = attrs.getURI(i);
            String value = attrs.getValue(i);
            String qname = attrs.getQName(i);
            element.setAttributeNS(namespaceuri, qname, value);
        }
    }
    // append this new node onto current stack node
    parent.appendChild(element);
    // push this node onto stack
    nodeStack.push(element);
}
 
Example #6
Source File: JAXBContextImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public String toString() {
    StringBuilder buf = new StringBuilder(Which.which(getClass()) + " Build-Id: " + getBuildId());
    buf.append("\nClasses known to this context:\n");

    Set<String> names = new TreeSet<String>();  // sort them so that it's easy to read

    for (Class key : beanInfoMap.keySet())
        names.add(key.getName());

    for(String name: names)
        buf.append("  ").append(name).append('\n');

    return buf.toString();
}
 
Example #7
Source File: SAX2DOMEx.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public void startElement(String namespace, String localName, String qName, Attributes attrs) {
    Node parent = nodeStack.peek();

    // some broken DOM implementation (we confirmed it with SAXON)
    // return null from this method.
    Element element = document.createElementNS(namespace, qName);

    if (element == null) {
        // if so, report an user-friendly error message,
        // rather than dying mysteriously with NPE.
        throw new AssertionError(
                Messages.format(Messages.DOM_IMPL_DOESNT_SUPPORT_CREATELEMENTNS,
                document.getClass().getName(),
                Which.which(document.getClass())));
    }

    // process namespace bindings
    for (int i = 0; i < unprocessedNamespaces.size(); i += 2) {
        String prefix = unprocessedNamespaces.get(i);
        String uri = unprocessedNamespaces.get(i + 1);

        namespace(element, prefix, uri);
    }
    unprocessedNamespaces.clear();


    if (attrs != null) {
        int length = attrs.getLength();
        for (int i = 0; i < length; i++) {
            String namespaceuri = attrs.getURI(i);
            String value = attrs.getValue(i);
            String qname = attrs.getQName(i);
            element.setAttributeNS(namespaceuri, qname, value);
        }
    }
    // append this new node onto current stack node
    parent.appendChild(element);
    // push this node onto stack
    nodeStack.push(element);
}
 
Example #8
Source File: JAXBContextImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
public String toString() {
    StringBuilder buf = new StringBuilder(Which.which(getClass()) + " Build-Id: " + getBuildId());
    buf.append("\nClasses known to this context:\n");

    Set<String> names = new TreeSet<String>();  // sort them so that it's easy to read

    for (Class key : beanInfoMap.keySet())
        names.add(key.getName());

    for(String name: names)
        buf.append("  ").append(name).append('\n');

    return buf.toString();
}
 
Example #9
Source File: SAX2DOMEx.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void startElement(String namespace, String localName, String qName, Attributes attrs) {
    Node parent = nodeStack.peek();

    // some broken DOM implementation (we confirmed it with SAXON)
    // return null from this method.
    Element element = document.createElementNS(namespace, qName);

    if (element == null) {
        // if so, report an user-friendly error message,
        // rather than dying mysteriously with NPE.
        throw new AssertionError(
                Messages.format(Messages.DOM_IMPL_DOESNT_SUPPORT_CREATELEMENTNS,
                document.getClass().getName(),
                Which.which(document.getClass())));
    }

    // process namespace bindings
    for (int i = 0; i < unprocessedNamespaces.size(); i += 2) {
        String prefix = unprocessedNamespaces.get(i);
        String uri = unprocessedNamespaces.get(i + 1);

        namespace(element, prefix, uri);
    }
    unprocessedNamespaces.clear();


    if (attrs != null) {
        int length = attrs.getLength();
        for (int i = 0; i < length; i++) {
            String namespaceuri = attrs.getURI(i);
            String value = attrs.getValue(i);
            String qname = attrs.getQName(i);
            element.setAttributeNS(namespaceuri, qname, value);
        }
    }
    // append this new node onto current stack node
    parent.appendChild(element);
    // push this node onto stack
    nodeStack.push(element);
}
 
Example #10
Source File: JAXBContextImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public String toString() {
    StringBuilder buf = new StringBuilder(Which.which(getClass()) + " Build-Id: " + getBuildId());
    buf.append("\nClasses known to this context:\n");

    Set<String> names = new TreeSet<String>();  // sort them so that it's easy to read

    for (Class key : beanInfoMap.keySet())
        names.add(key.getName());

    for(String name: names)
        buf.append("  ").append(name).append('\n');

    return buf.toString();
}
 
Example #11
Source File: SAX2DOMEx.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public void startElement(String namespace, String localName, String qName, Attributes attrs) {
    Node parent = nodeStack.peek();

    // some broken DOM implementation (we confirmed it with SAXON)
    // return null from this method.
    Element element = document.createElementNS(namespace, qName);

    if (element == null) {
        // if so, report an user-friendly error message,
        // rather than dying mysteriously with NPE.
        throw new AssertionError(
                Messages.format(Messages.DOM_IMPL_DOESNT_SUPPORT_CREATELEMENTNS,
                document.getClass().getName(),
                Which.which(document.getClass())));
    }

    // process namespace bindings
    for (int i = 0; i < unprocessedNamespaces.size(); i += 2) {
        String prefix = unprocessedNamespaces.get(i);
        String uri = unprocessedNamespaces.get(i + 1);

        namespace(element, prefix, uri);
    }
    unprocessedNamespaces.clear();


    if (attrs != null) {
        int length = attrs.getLength();
        for (int i = 0; i < length; i++) {
            String namespaceuri = attrs.getURI(i);
            String value = attrs.getValue(i);
            String qname = attrs.getQName(i);
            element.setAttributeNS(namespaceuri, qname, value);
        }
    }
    // append this new node onto current stack node
    parent.appendChild(element);
    // push this node onto stack
    nodeStack.push(element);
}
 
Example #12
Source File: JAXBContextImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
public String toString() {
    StringBuilder buf = new StringBuilder(Which.which(getClass()) + " Build-Id: " + getBuildId());
    buf.append("\nClasses known to this context:\n");

    Set<String> names = new TreeSet<String>();  // sort them so that it's easy to read

    for (Class key : beanInfoMap.keySet())
        names.add(key.getName());

    for(String name: names)
        buf.append("  ").append(name).append('\n');

    return buf.toString();
}
 
Example #13
Source File: SAX2DOMEx.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void startElement(String namespace, String localName, String qName, Attributes attrs) {
    Node parent = nodeStack.peek();

    // some broken DOM implementation (we confirmed it with SAXON)
    // return null from this method.
    Element element = document.createElementNS(namespace, qName);

    if (element == null) {
        // if so, report an user-friendly error message,
        // rather than dying mysteriously with NPE.
        throw new AssertionError(
                Messages.format(Messages.DOM_IMPL_DOESNT_SUPPORT_CREATELEMENTNS,
                document.getClass().getName(),
                Which.which(document.getClass())));
    }

    // process namespace bindings
    for (int i = 0; i < unprocessedNamespaces.size(); i += 2) {
        String prefix = unprocessedNamespaces.get(i);
        String uri = unprocessedNamespaces.get(i + 1);

        namespace(element, prefix, uri);
    }
    unprocessedNamespaces.clear();


    if (attrs != null) {
        int length = attrs.getLength();
        for (int i = 0; i < length; i++) {
            String namespaceuri = attrs.getURI(i);
            String value = attrs.getValue(i);
            String qname = attrs.getQName(i);
            element.setAttributeNS(namespaceuri, qname, value);
        }
    }
    // append this new node onto current stack node
    parent.appendChild(element);
    // push this node onto stack
    nodeStack.push(element);
}
 
Example #14
Source File: JAXBContextImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
@Override
public String toString() {
    StringBuilder buf = new StringBuilder(Which.which(getClass()) + " Build-Id: " + getBuildId());
    buf.append("\nClasses known to this context:\n");

    Set<String> names = new TreeSet<String>();  // sort them so that it's easy to read

    for (Class key : beanInfoMap.keySet())
        names.add(key.getName());

    for(String name: names)
        buf.append("  ").append(name).append('\n');

    return buf.toString();
}
 
Example #15
Source File: SAX2DOMEx.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void startElement(String namespace, String localName, String qName, Attributes attrs) {
    Node parent = nodeStack.peek();

    // some broken DOM implementation (we confirmed it with SAXON)
    // return null from this method.
    Element element = document.createElementNS(namespace, qName);

    if (element == null) {
        // if so, report an user-friendly error message,
        // rather than dying mysteriously with NPE.
        throw new AssertionError(
                Messages.format(Messages.DOM_IMPL_DOESNT_SUPPORT_CREATELEMENTNS,
                document.getClass().getName(),
                Which.which(document.getClass())));
    }

    // process namespace bindings
    for (int i = 0; i < unprocessedNamespaces.size(); i += 2) {
        String prefix = unprocessedNamespaces.get(i);
        String uri = unprocessedNamespaces.get(i + 1);

        namespace(element, prefix, uri);
    }
    unprocessedNamespaces.clear();


    if (attrs != null) {
        int length = attrs.getLength();
        for (int i = 0; i < length; i++) {
            String namespaceuri = attrs.getURI(i);
            String value = attrs.getValue(i);
            String qname = attrs.getQName(i);
            element.setAttributeNS(namespaceuri, qname, value);
        }
    }
    // append this new node onto current stack node
    parent.appendChild(element);
    // push this node onto stack
    nodeStack.push(element);
}
 
Example #16
Source File: JAXBContextImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public String toString() {
    StringBuilder buf = new StringBuilder(Which.which(getClass()) + " Build-Id: " + getBuildId());
    buf.append("\nClasses known to this context:\n");

    Set<String> names = new TreeSet<String>();  // sort them so that it's easy to read

    for (Class key : beanInfoMap.keySet())
        names.add(key.getName());

    for(String name: names)
        buf.append("  ").append(name).append('\n');

    return buf.toString();
}