Java源码示例:com.sun.xml.internal.bind.util.Which

示例1
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);
}
 
示例2
@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();
}
 
示例3
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);
}
 
示例4
@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();
}
 
示例5
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);
}
 
示例6
@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();
}
 
示例7
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);
}
 
示例8
@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();
}
 
示例9
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);
}
 
示例10
@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();
}
 
示例11
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);
}
 
示例12
@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();
}
 
示例13
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);
}
 
示例14
@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();
}
 
示例15
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);
}
 
示例16
@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();
}