Java Code Examples for com.sun.tools.internal.ws.wsdl.framework.TWSDLParserContextImpl#getLocation()

The following examples show how to use com.sun.tools.internal.ws.wsdl.framework.TWSDLParserContextImpl#getLocation() . 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: SOAPExtensionHandler.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
private boolean handleHeaderElement(TWSDLExtensible parent, Element e, TWSDLParserContextImpl context) {
    context.push();
    context.registerNamespaces(e);

    SOAPHeader header = new SOAPHeader(context.getLocation(e));

    String use = XmlUtil.getAttributeOrNull(e, Constants.ATTR_USE);
    if (use != null) {
        if (use.equals(Constants.ATTRVALUE_LITERAL)) {
            header.setUse(SOAPUse.LITERAL);
        } else if (use.equals(Constants.ATTRVALUE_ENCODED)) {
            header.setUse(SOAPUse.ENCODED);
        } else {
            Util.fail("parsing.invalidAttributeValue", Constants.ATTR_USE, use);
        }
    }

    String namespace = XmlUtil.getAttributeOrNull(e, Constants.ATTR_NAMESPACE);
    if (namespace != null) {
        header.setNamespace(namespace);
    }

    String encodingStyle = XmlUtil.getAttributeOrNull(e, Constants.ATTR_ENCODING_STYLE);
    if (encodingStyle != null) {
        header.setEncodingStyle(encodingStyle);
    }

    String part = XmlUtil.getAttributeOrNull(e, Constants.ATTR_PART);
    if (part != null) {
        header.setPart(part);
    }

    String messageAttr = XmlUtil.getAttributeOrNull(e, Constants.ATTR_MESSAGE);
    if (messageAttr != null) {
        header.setMessage(context.translateQualifiedName(context.getLocation(e), messageAttr));
    }

    for (Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();) {
        Element e2 = Util.nextElement(iter);
        if (e2 == null)
            break;

        if (XmlUtil.matchesTagNS(e2, getHeaderfaultQName())) {
            handleHeaderFaultElement(e, context, header, use, e2);
        } else {
            Util.fail("parsing.invalidElement", e2.getTagName(), e2.getNamespaceURI());
        }
    }

    parent.addExtension(header);
    context.pop();
    context.fireDoneParsingEntity(getHeaderQName(), header);
    return true;
}
 
Example 2
Source File: SOAPExtensionHandler.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
private boolean handleHeaderElement(TWSDLExtensible parent, Element e, TWSDLParserContextImpl context) {
    context.push();
    context.registerNamespaces(e);

    SOAPHeader header = new SOAPHeader(context.getLocation(e));

    String use = XmlUtil.getAttributeOrNull(e, Constants.ATTR_USE);
    if (use != null) {
        if (use.equals(Constants.ATTRVALUE_LITERAL)) {
            header.setUse(SOAPUse.LITERAL);
        } else if (use.equals(Constants.ATTRVALUE_ENCODED)) {
            header.setUse(SOAPUse.ENCODED);
        } else {
            Util.fail("parsing.invalidAttributeValue", Constants.ATTR_USE, use);
        }
    }

    String namespace = XmlUtil.getAttributeOrNull(e, Constants.ATTR_NAMESPACE);
    if (namespace != null) {
        header.setNamespace(namespace);
    }

    String encodingStyle = XmlUtil.getAttributeOrNull(e, Constants.ATTR_ENCODING_STYLE);
    if (encodingStyle != null) {
        header.setEncodingStyle(encodingStyle);
    }

    String part = XmlUtil.getAttributeOrNull(e, Constants.ATTR_PART);
    if (part != null) {
        header.setPart(part);
    }

    String messageAttr = XmlUtil.getAttributeOrNull(e, Constants.ATTR_MESSAGE);
    if (messageAttr != null) {
        header.setMessage(context.translateQualifiedName(context.getLocation(e), messageAttr));
    }

    for (Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();) {
        Element e2 = Util.nextElement(iter);
        if (e2 == null)
            break;

        if (XmlUtil.matchesTagNS(e2, getHeaderfaultQName())) {
            handleHeaderFaultElement(e, context, header, use, e2);
        } else {
            Util.fail("parsing.invalidElement", e2.getTagName(), e2.getNamespaceURI());
        }
    }

    parent.addExtension(header);
    context.pop();
    context.fireDoneParsingEntity(getHeaderQName(), header);
    return true;
}
 
Example 3
Source File: SOAPExtensionHandler.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
protected boolean handleInputOutputExtension(
        TWSDLParserContext contextif,
        TWSDLExtensible parent,
        Element e) {
        TWSDLParserContextImpl context = (TWSDLParserContextImpl)contextif;
        if (XmlUtil.matchesTagNS(e, getBodyQName())) {
            context.push();
            context.registerNamespaces(e);

            SOAPBody body = new SOAPBody(context.getLocation(e));

            String use = XmlUtil.getAttributeOrNull(e, Constants.ATTR_USE);
            if (use != null) {
                if (use.equals(Constants.ATTRVALUE_LITERAL)) {
                    body.setUse(SOAPUse.LITERAL);
                } else if (use.equals(Constants.ATTRVALUE_ENCODED)) {
                    body.setUse(SOAPUse.ENCODED);
                } else {
                    Util.fail(
                        "parsing.invalidAttributeValue",
                        Constants.ATTR_USE,
                        use);
                }
            }

            String namespace =
                XmlUtil.getAttributeOrNull(e, Constants.ATTR_NAMESPACE);
            if (namespace != null) {
                body.setNamespace(namespace);
            }

            String encodingStyle =
                XmlUtil.getAttributeOrNull(e, Constants.ATTR_ENCODING_STYLE);
            if (encodingStyle != null) {
                body.setEncodingStyle(encodingStyle);
            }

            String parts = XmlUtil.getAttributeOrNull(e, Constants.ATTR_PARTS);
            if (parts != null) {
                body.setParts(parts);
            }

            parent.addExtension(body);
            context.pop();
//            context.fireDoneParsingEntity(getBodyQName(), body);
            return true;
        } else if (XmlUtil.matchesTagNS(e, getHeaderQName())) {
            return handleHeaderElement(parent, e, context);
        } else {
            Util.fail("parsing.invalidExtensionElement", e.getTagName(), e.getNamespaceURI());
            return false; // keep compiler happy
        }
    }
 
Example 4
Source File: SOAPExtensionHandler.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
private void handleHeaderFaultElement(Element e, TWSDLParserContextImpl context, SOAPHeader header, String use, Element e2) {
    context.push();
    context.registerNamespaces(e);

    SOAPHeaderFault headerfault = new SOAPHeaderFault(context.getLocation(e));

    String use2 = XmlUtil.getAttributeOrNull(e2, Constants.ATTR_USE);
    if (use2 != null) {
        if (use2.equals(Constants.ATTRVALUE_LITERAL)) {
            headerfault.setUse(SOAPUse.LITERAL);
        } else if (use.equals(Constants.ATTRVALUE_ENCODED)) {
            headerfault.setUse(SOAPUse.ENCODED);
        } else {
            Util.fail("parsing.invalidAttributeValue", Constants.ATTR_USE, use2);
        }
    }

    String namespace2 = XmlUtil.getAttributeOrNull(e2, Constants.ATTR_NAMESPACE);
    if (namespace2 != null) {
        headerfault.setNamespace(namespace2);
    }

    String encodingStyle2 = XmlUtil.getAttributeOrNull(e2, Constants.ATTR_ENCODING_STYLE);
    if (encodingStyle2 != null) {
        headerfault.setEncodingStyle(encodingStyle2);
    }

    String part2 = XmlUtil.getAttributeOrNull(e2, Constants.ATTR_PART);
    if (part2 != null) {
        headerfault.setPart(part2);
    }

    String messageAttr2 = XmlUtil.getAttributeOrNull(e2, Constants.ATTR_MESSAGE);
    if (messageAttr2 != null) {
        headerfault.setMessage(
            context.translateQualifiedName(context.getLocation(e2), messageAttr2));
    }

    header.add(headerfault);
    context.pop();
}
 
Example 5
Source File: SOAPExtensionHandler.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
private boolean handleHeaderElement(TWSDLExtensible parent, Element e, TWSDLParserContextImpl context) {
    context.push();
    context.registerNamespaces(e);

    SOAPHeader header = new SOAPHeader(context.getLocation(e));

    String use = XmlUtil.getAttributeOrNull(e, Constants.ATTR_USE);
    if (use != null) {
        if (use.equals(Constants.ATTRVALUE_LITERAL)) {
            header.setUse(SOAPUse.LITERAL);
        } else if (use.equals(Constants.ATTRVALUE_ENCODED)) {
            header.setUse(SOAPUse.ENCODED);
        } else {
            Util.fail("parsing.invalidAttributeValue", Constants.ATTR_USE, use);
        }
    }

    String namespace = XmlUtil.getAttributeOrNull(e, Constants.ATTR_NAMESPACE);
    if (namespace != null) {
        header.setNamespace(namespace);
    }

    String encodingStyle = XmlUtil.getAttributeOrNull(e, Constants.ATTR_ENCODING_STYLE);
    if (encodingStyle != null) {
        header.setEncodingStyle(encodingStyle);
    }

    String part = XmlUtil.getAttributeOrNull(e, Constants.ATTR_PART);
    if (part != null) {
        header.setPart(part);
    }

    String messageAttr = XmlUtil.getAttributeOrNull(e, Constants.ATTR_MESSAGE);
    if (messageAttr != null) {
        header.setMessage(context.translateQualifiedName(context.getLocation(e), messageAttr));
    }

    for (Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();) {
        Element e2 = Util.nextElement(iter);
        if (e2 == null)
            break;

        if (XmlUtil.matchesTagNS(e2, getHeaderfaultQName())) {
            handleHeaderFaultElement(e, context, header, use, e2);
        } else {
            Util.fail("parsing.invalidElement", e2.getTagName(), e2.getNamespaceURI());
        }
    }

    parent.addExtension(header);
    context.pop();
    context.fireDoneParsingEntity(getHeaderQName(), header);
    return true;
}
 
Example 6
Source File: SOAPExtensionHandler.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
private void handleHeaderFaultElement(Element e, TWSDLParserContextImpl context, SOAPHeader header, String use, Element e2) {
    context.push();
    context.registerNamespaces(e);

    SOAPHeaderFault headerfault = new SOAPHeaderFault(context.getLocation(e));

    String use2 = XmlUtil.getAttributeOrNull(e2, Constants.ATTR_USE);
    if (use2 != null) {
        if (use2.equals(Constants.ATTRVALUE_LITERAL)) {
            headerfault.setUse(SOAPUse.LITERAL);
        } else if (use.equals(Constants.ATTRVALUE_ENCODED)) {
            headerfault.setUse(SOAPUse.ENCODED);
        } else {
            Util.fail("parsing.invalidAttributeValue", Constants.ATTR_USE, use2);
        }
    }

    String namespace2 = XmlUtil.getAttributeOrNull(e2, Constants.ATTR_NAMESPACE);
    if (namespace2 != null) {
        headerfault.setNamespace(namespace2);
    }

    String encodingStyle2 = XmlUtil.getAttributeOrNull(e2, Constants.ATTR_ENCODING_STYLE);
    if (encodingStyle2 != null) {
        headerfault.setEncodingStyle(encodingStyle2);
    }

    String part2 = XmlUtil.getAttributeOrNull(e2, Constants.ATTR_PART);
    if (part2 != null) {
        headerfault.setPart(part2);
    }

    String messageAttr2 = XmlUtil.getAttributeOrNull(e2, Constants.ATTR_MESSAGE);
    if (messageAttr2 != null) {
        headerfault.setMessage(
            context.translateQualifiedName(context.getLocation(e2), messageAttr2));
    }

    header.add(headerfault);
    context.pop();
}
 
Example 7
Source File: SOAPExtensionHandler.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
private void handleHeaderFaultElement(Element e, TWSDLParserContextImpl context, SOAPHeader header, String use, Element e2) {
    context.push();
    context.registerNamespaces(e);

    SOAPHeaderFault headerfault = new SOAPHeaderFault(context.getLocation(e));

    String use2 = XmlUtil.getAttributeOrNull(e2, Constants.ATTR_USE);
    if (use2 != null) {
        if (use2.equals(Constants.ATTRVALUE_LITERAL)) {
            headerfault.setUse(SOAPUse.LITERAL);
        } else if (use.equals(Constants.ATTRVALUE_ENCODED)) {
            headerfault.setUse(SOAPUse.ENCODED);
        } else {
            Util.fail("parsing.invalidAttributeValue", Constants.ATTR_USE, use2);
        }
    }

    String namespace2 = XmlUtil.getAttributeOrNull(e2, Constants.ATTR_NAMESPACE);
    if (namespace2 != null) {
        headerfault.setNamespace(namespace2);
    }

    String encodingStyle2 = XmlUtil.getAttributeOrNull(e2, Constants.ATTR_ENCODING_STYLE);
    if (encodingStyle2 != null) {
        headerfault.setEncodingStyle(encodingStyle2);
    }

    String part2 = XmlUtil.getAttributeOrNull(e2, Constants.ATTR_PART);
    if (part2 != null) {
        headerfault.setPart(part2);
    }

    String messageAttr2 = XmlUtil.getAttributeOrNull(e2, Constants.ATTR_MESSAGE);
    if (messageAttr2 != null) {
        headerfault.setMessage(
            context.translateQualifiedName(context.getLocation(e2), messageAttr2));
    }

    header.add(headerfault);
    context.pop();
}
 
Example 8
Source File: SOAPExtensionHandler.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
private boolean handleHeaderElement(TWSDLExtensible parent, Element e, TWSDLParserContextImpl context) {
    context.push();
    context.registerNamespaces(e);

    SOAPHeader header = new SOAPHeader(context.getLocation(e));

    String use = XmlUtil.getAttributeOrNull(e, Constants.ATTR_USE);
    if (use != null) {
        if (use.equals(Constants.ATTRVALUE_LITERAL)) {
            header.setUse(SOAPUse.LITERAL);
        } else if (use.equals(Constants.ATTRVALUE_ENCODED)) {
            header.setUse(SOAPUse.ENCODED);
        } else {
            Util.fail("parsing.invalidAttributeValue", Constants.ATTR_USE, use);
        }
    }

    String namespace = XmlUtil.getAttributeOrNull(e, Constants.ATTR_NAMESPACE);
    if (namespace != null) {
        header.setNamespace(namespace);
    }

    String encodingStyle = XmlUtil.getAttributeOrNull(e, Constants.ATTR_ENCODING_STYLE);
    if (encodingStyle != null) {
        header.setEncodingStyle(encodingStyle);
    }

    String part = XmlUtil.getAttributeOrNull(e, Constants.ATTR_PART);
    if (part != null) {
        header.setPart(part);
    }

    String messageAttr = XmlUtil.getAttributeOrNull(e, Constants.ATTR_MESSAGE);
    if (messageAttr != null) {
        header.setMessage(context.translateQualifiedName(context.getLocation(e), messageAttr));
    }

    for (Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();) {
        Element e2 = Util.nextElement(iter);
        if (e2 == null)
            break;

        if (XmlUtil.matchesTagNS(e2, getHeaderfaultQName())) {
            handleHeaderFaultElement(e, context, header, use, e2);
        } else {
            Util.fail("parsing.invalidElement", e2.getTagName(), e2.getNamespaceURI());
        }
    }

    parent.addExtension(header);
    context.pop();
    context.fireDoneParsingEntity(getHeaderQName(), header);
    return true;
}
 
Example 9
Source File: SOAPExtensionHandler.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
protected boolean handleInputOutputExtension(
        TWSDLParserContext contextif,
        TWSDLExtensible parent,
        Element e) {
        TWSDLParserContextImpl context = (TWSDLParserContextImpl)contextif;
        if (XmlUtil.matchesTagNS(e, getBodyQName())) {
            context.push();
            context.registerNamespaces(e);

            SOAPBody body = new SOAPBody(context.getLocation(e));

            String use = XmlUtil.getAttributeOrNull(e, Constants.ATTR_USE);
            if (use != null) {
                if (use.equals(Constants.ATTRVALUE_LITERAL)) {
                    body.setUse(SOAPUse.LITERAL);
                } else if (use.equals(Constants.ATTRVALUE_ENCODED)) {
                    body.setUse(SOAPUse.ENCODED);
                } else {
                    Util.fail(
                        "parsing.invalidAttributeValue",
                        Constants.ATTR_USE,
                        use);
                }
            }

            String namespace =
                XmlUtil.getAttributeOrNull(e, Constants.ATTR_NAMESPACE);
            if (namespace != null) {
                body.setNamespace(namespace);
            }

            String encodingStyle =
                XmlUtil.getAttributeOrNull(e, Constants.ATTR_ENCODING_STYLE);
            if (encodingStyle != null) {
                body.setEncodingStyle(encodingStyle);
            }

            String parts = XmlUtil.getAttributeOrNull(e, Constants.ATTR_PARTS);
            if (parts != null) {
                body.setParts(parts);
            }

            parent.addExtension(body);
            context.pop();
//            context.fireDoneParsingEntity(getBodyQName(), body);
            return true;
        } else if (XmlUtil.matchesTagNS(e, getHeaderQName())) {
            return handleHeaderElement(parent, e, context);
        } else {
            Util.fail("parsing.invalidExtensionElement", e.getTagName(), e.getNamespaceURI());
            return false; // keep compiler happy
        }
    }
 
Example 10
Source File: SOAPExtensionHandler.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
private void handleHeaderFaultElement(Element e, TWSDLParserContextImpl context, SOAPHeader header, String use, Element e2) {
    context.push();
    context.registerNamespaces(e);

    SOAPHeaderFault headerfault = new SOAPHeaderFault(context.getLocation(e));

    String use2 = XmlUtil.getAttributeOrNull(e2, Constants.ATTR_USE);
    if (use2 != null) {
        if (use2.equals(Constants.ATTRVALUE_LITERAL)) {
            headerfault.setUse(SOAPUse.LITERAL);
        } else if (use.equals(Constants.ATTRVALUE_ENCODED)) {
            headerfault.setUse(SOAPUse.ENCODED);
        } else {
            Util.fail("parsing.invalidAttributeValue", Constants.ATTR_USE, use2);
        }
    }

    String namespace2 = XmlUtil.getAttributeOrNull(e2, Constants.ATTR_NAMESPACE);
    if (namespace2 != null) {
        headerfault.setNamespace(namespace2);
    }

    String encodingStyle2 = XmlUtil.getAttributeOrNull(e2, Constants.ATTR_ENCODING_STYLE);
    if (encodingStyle2 != null) {
        headerfault.setEncodingStyle(encodingStyle2);
    }

    String part2 = XmlUtil.getAttributeOrNull(e2, Constants.ATTR_PART);
    if (part2 != null) {
        headerfault.setPart(part2);
    }

    String messageAttr2 = XmlUtil.getAttributeOrNull(e2, Constants.ATTR_MESSAGE);
    if (messageAttr2 != null) {
        headerfault.setMessage(
            context.translateQualifiedName(context.getLocation(e2), messageAttr2));
    }

    header.add(headerfault);
    context.pop();
}
 
Example 11
Source File: SOAPExtensionHandler.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
protected boolean handleInputOutputExtension(
        TWSDLParserContext contextif,
        TWSDLExtensible parent,
        Element e) {
        TWSDLParserContextImpl context = (TWSDLParserContextImpl)contextif;
        if (XmlUtil.matchesTagNS(e, getBodyQName())) {
            context.push();
            context.registerNamespaces(e);

            SOAPBody body = new SOAPBody(context.getLocation(e));

            String use = XmlUtil.getAttributeOrNull(e, Constants.ATTR_USE);
            if (use != null) {
                if (use.equals(Constants.ATTRVALUE_LITERAL)) {
                    body.setUse(SOAPUse.LITERAL);
                } else if (use.equals(Constants.ATTRVALUE_ENCODED)) {
                    body.setUse(SOAPUse.ENCODED);
                } else {
                    Util.fail(
                        "parsing.invalidAttributeValue",
                        Constants.ATTR_USE,
                        use);
                }
            }

            String namespace =
                XmlUtil.getAttributeOrNull(e, Constants.ATTR_NAMESPACE);
            if (namespace != null) {
                body.setNamespace(namespace);
            }

            String encodingStyle =
                XmlUtil.getAttributeOrNull(e, Constants.ATTR_ENCODING_STYLE);
            if (encodingStyle != null) {
                body.setEncodingStyle(encodingStyle);
            }

            String parts = XmlUtil.getAttributeOrNull(e, Constants.ATTR_PARTS);
            if (parts != null) {
                body.setParts(parts);
            }

            parent.addExtension(body);
            context.pop();
//            context.fireDoneParsingEntity(getBodyQName(), body);
            return true;
        } else if (XmlUtil.matchesTagNS(e, getHeaderQName())) {
            return handleHeaderElement(parent, e, context);
        } else {
            Util.fail("parsing.invalidExtensionElement", e.getTagName(), e.getNamespaceURI());
            return false; // keep compiler happy
        }
    }
 
Example 12
Source File: SOAPExtensionHandler.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
protected boolean handleInputOutputExtension(
        TWSDLParserContext contextif,
        TWSDLExtensible parent,
        Element e) {
        TWSDLParserContextImpl context = (TWSDLParserContextImpl)contextif;
        if (XmlUtil.matchesTagNS(e, getBodyQName())) {
            context.push();
            context.registerNamespaces(e);

            SOAPBody body = new SOAPBody(context.getLocation(e));

            String use = XmlUtil.getAttributeOrNull(e, Constants.ATTR_USE);
            if (use != null) {
                if (use.equals(Constants.ATTRVALUE_LITERAL)) {
                    body.setUse(SOAPUse.LITERAL);
                } else if (use.equals(Constants.ATTRVALUE_ENCODED)) {
                    body.setUse(SOAPUse.ENCODED);
                } else {
                    Util.fail(
                        "parsing.invalidAttributeValue",
                        Constants.ATTR_USE,
                        use);
                }
            }

            String namespace =
                XmlUtil.getAttributeOrNull(e, Constants.ATTR_NAMESPACE);
            if (namespace != null) {
                body.setNamespace(namespace);
            }

            String encodingStyle =
                XmlUtil.getAttributeOrNull(e, Constants.ATTR_ENCODING_STYLE);
            if (encodingStyle != null) {
                body.setEncodingStyle(encodingStyle);
            }

            String parts = XmlUtil.getAttributeOrNull(e, Constants.ATTR_PARTS);
            if (parts != null) {
                body.setParts(parts);
            }

            parent.addExtension(body);
            context.pop();
//            context.fireDoneParsingEntity(getBodyQName(), body);
            return true;
        } else if (XmlUtil.matchesTagNS(e, getHeaderQName())) {
            return handleHeaderElement(parent, e, context);
        } else {
            Util.fail("parsing.invalidExtensionElement", e.getTagName(), e.getNamespaceURI());
            return false; // keep compiler happy
        }
    }
 
Example 13
Source File: SOAPExtensionHandler.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
private void handleHeaderFaultElement(Element e, TWSDLParserContextImpl context, SOAPHeader header, String use, Element e2) {
    context.push();
    context.registerNamespaces(e);

    SOAPHeaderFault headerfault = new SOAPHeaderFault(context.getLocation(e));

    String use2 = XmlUtil.getAttributeOrNull(e2, Constants.ATTR_USE);
    if (use2 != null) {
        if (use2.equals(Constants.ATTRVALUE_LITERAL)) {
            headerfault.setUse(SOAPUse.LITERAL);
        } else if (use.equals(Constants.ATTRVALUE_ENCODED)) {
            headerfault.setUse(SOAPUse.ENCODED);
        } else {
            Util.fail("parsing.invalidAttributeValue", Constants.ATTR_USE, use2);
        }
    }

    String namespace2 = XmlUtil.getAttributeOrNull(e2, Constants.ATTR_NAMESPACE);
    if (namespace2 != null) {
        headerfault.setNamespace(namespace2);
    }

    String encodingStyle2 = XmlUtil.getAttributeOrNull(e2, Constants.ATTR_ENCODING_STYLE);
    if (encodingStyle2 != null) {
        headerfault.setEncodingStyle(encodingStyle2);
    }

    String part2 = XmlUtil.getAttributeOrNull(e2, Constants.ATTR_PART);
    if (part2 != null) {
        headerfault.setPart(part2);
    }

    String messageAttr2 = XmlUtil.getAttributeOrNull(e2, Constants.ATTR_MESSAGE);
    if (messageAttr2 != null) {
        headerfault.setMessage(
            context.translateQualifiedName(context.getLocation(e2), messageAttr2));
    }

    header.add(headerfault);
    context.pop();
}
 
Example 14
Source File: SOAPExtensionHandler.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
private boolean handleHeaderElement(TWSDLExtensible parent, Element e, TWSDLParserContextImpl context) {
    context.push();
    context.registerNamespaces(e);

    SOAPHeader header = new SOAPHeader(context.getLocation(e));

    String use = XmlUtil.getAttributeOrNull(e, Constants.ATTR_USE);
    if (use != null) {
        if (use.equals(Constants.ATTRVALUE_LITERAL)) {
            header.setUse(SOAPUse.LITERAL);
        } else if (use.equals(Constants.ATTRVALUE_ENCODED)) {
            header.setUse(SOAPUse.ENCODED);
        } else {
            Util.fail("parsing.invalidAttributeValue", Constants.ATTR_USE, use);
        }
    }

    String namespace = XmlUtil.getAttributeOrNull(e, Constants.ATTR_NAMESPACE);
    if (namespace != null) {
        header.setNamespace(namespace);
    }

    String encodingStyle = XmlUtil.getAttributeOrNull(e, Constants.ATTR_ENCODING_STYLE);
    if (encodingStyle != null) {
        header.setEncodingStyle(encodingStyle);
    }

    String part = XmlUtil.getAttributeOrNull(e, Constants.ATTR_PART);
    if (part != null) {
        header.setPart(part);
    }

    String messageAttr = XmlUtil.getAttributeOrNull(e, Constants.ATTR_MESSAGE);
    if (messageAttr != null) {
        header.setMessage(context.translateQualifiedName(context.getLocation(e), messageAttr));
    }

    for (Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();) {
        Element e2 = Util.nextElement(iter);
        if (e2 == null)
            break;

        if (XmlUtil.matchesTagNS(e2, getHeaderfaultQName())) {
            handleHeaderFaultElement(e, context, header, use, e2);
        } else {
            Util.fail("parsing.invalidElement", e2.getTagName(), e2.getNamespaceURI());
        }
    }

    parent.addExtension(header);
    context.pop();
    context.fireDoneParsingEntity(getHeaderQName(), header);
    return true;
}
 
Example 15
Source File: SOAPExtensionHandler.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
protected boolean handleInputOutputExtension(
        TWSDLParserContext contextif,
        TWSDLExtensible parent,
        Element e) {
        TWSDLParserContextImpl context = (TWSDLParserContextImpl)contextif;
        if (XmlUtil.matchesTagNS(e, getBodyQName())) {
            context.push();
            context.registerNamespaces(e);

            SOAPBody body = new SOAPBody(context.getLocation(e));

            String use = XmlUtil.getAttributeOrNull(e, Constants.ATTR_USE);
            if (use != null) {
                if (use.equals(Constants.ATTRVALUE_LITERAL)) {
                    body.setUse(SOAPUse.LITERAL);
                } else if (use.equals(Constants.ATTRVALUE_ENCODED)) {
                    body.setUse(SOAPUse.ENCODED);
                } else {
                    Util.fail(
                        "parsing.invalidAttributeValue",
                        Constants.ATTR_USE,
                        use);
                }
            }

            String namespace =
                XmlUtil.getAttributeOrNull(e, Constants.ATTR_NAMESPACE);
            if (namespace != null) {
                body.setNamespace(namespace);
            }

            String encodingStyle =
                XmlUtil.getAttributeOrNull(e, Constants.ATTR_ENCODING_STYLE);
            if (encodingStyle != null) {
                body.setEncodingStyle(encodingStyle);
            }

            String parts = XmlUtil.getAttributeOrNull(e, Constants.ATTR_PARTS);
            if (parts != null) {
                body.setParts(parts);
            }

            parent.addExtension(body);
            context.pop();
//            context.fireDoneParsingEntity(getBodyQName(), body);
            return true;
        } else if (XmlUtil.matchesTagNS(e, getHeaderQName())) {
            return handleHeaderElement(parent, e, context);
        } else {
            Util.fail("parsing.invalidExtensionElement", e.getTagName(), e.getNamespaceURI());
            return false; // keep compiler happy
        }
    }
 
Example 16
Source File: SOAPExtensionHandler.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
private void handleHeaderFaultElement(Element e, TWSDLParserContextImpl context, SOAPHeader header, String use, Element e2) {
    context.push();
    context.registerNamespaces(e);

    SOAPHeaderFault headerfault = new SOAPHeaderFault(context.getLocation(e));

    String use2 = XmlUtil.getAttributeOrNull(e2, Constants.ATTR_USE);
    if (use2 != null) {
        if (use2.equals(Constants.ATTRVALUE_LITERAL)) {
            headerfault.setUse(SOAPUse.LITERAL);
        } else if (use.equals(Constants.ATTRVALUE_ENCODED)) {
            headerfault.setUse(SOAPUse.ENCODED);
        } else {
            Util.fail("parsing.invalidAttributeValue", Constants.ATTR_USE, use2);
        }
    }

    String namespace2 = XmlUtil.getAttributeOrNull(e2, Constants.ATTR_NAMESPACE);
    if (namespace2 != null) {
        headerfault.setNamespace(namespace2);
    }

    String encodingStyle2 = XmlUtil.getAttributeOrNull(e2, Constants.ATTR_ENCODING_STYLE);
    if (encodingStyle2 != null) {
        headerfault.setEncodingStyle(encodingStyle2);
    }

    String part2 = XmlUtil.getAttributeOrNull(e2, Constants.ATTR_PART);
    if (part2 != null) {
        headerfault.setPart(part2);
    }

    String messageAttr2 = XmlUtil.getAttributeOrNull(e2, Constants.ATTR_MESSAGE);
    if (messageAttr2 != null) {
        headerfault.setMessage(
            context.translateQualifiedName(context.getLocation(e2), messageAttr2));
    }

    header.add(headerfault);
    context.pop();
}
 
Example 17
Source File: SOAPExtensionHandler.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
private boolean handleHeaderElement(TWSDLExtensible parent, Element e, TWSDLParserContextImpl context) {
    context.push();
    context.registerNamespaces(e);

    SOAPHeader header = new SOAPHeader(context.getLocation(e));

    String use = XmlUtil.getAttributeOrNull(e, Constants.ATTR_USE);
    if (use != null) {
        if (use.equals(Constants.ATTRVALUE_LITERAL)) {
            header.setUse(SOAPUse.LITERAL);
        } else if (use.equals(Constants.ATTRVALUE_ENCODED)) {
            header.setUse(SOAPUse.ENCODED);
        } else {
            Util.fail("parsing.invalidAttributeValue", Constants.ATTR_USE, use);
        }
    }

    String namespace = XmlUtil.getAttributeOrNull(e, Constants.ATTR_NAMESPACE);
    if (namespace != null) {
        header.setNamespace(namespace);
    }

    String encodingStyle = XmlUtil.getAttributeOrNull(e, Constants.ATTR_ENCODING_STYLE);
    if (encodingStyle != null) {
        header.setEncodingStyle(encodingStyle);
    }

    String part = XmlUtil.getAttributeOrNull(e, Constants.ATTR_PART);
    if (part != null) {
        header.setPart(part);
    }

    String messageAttr = XmlUtil.getAttributeOrNull(e, Constants.ATTR_MESSAGE);
    if (messageAttr != null) {
        header.setMessage(context.translateQualifiedName(context.getLocation(e), messageAttr));
    }

    for (Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();) {
        Element e2 = Util.nextElement(iter);
        if (e2 == null)
            break;

        if (XmlUtil.matchesTagNS(e2, getHeaderfaultQName())) {
            handleHeaderFaultElement(e, context, header, use, e2);
        } else {
            Util.fail("parsing.invalidElement", e2.getTagName(), e2.getNamespaceURI());
        }
    }

    parent.addExtension(header);
    context.pop();
    context.fireDoneParsingEntity(getHeaderQName(), header);
    return true;
}
 
Example 18
Source File: SOAPExtensionHandler.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
protected boolean handleInputOutputExtension(
        TWSDLParserContext contextif,
        TWSDLExtensible parent,
        Element e) {
        TWSDLParserContextImpl context = (TWSDLParserContextImpl)contextif;
        if (XmlUtil.matchesTagNS(e, getBodyQName())) {
            context.push();
            context.registerNamespaces(e);

            SOAPBody body = new SOAPBody(context.getLocation(e));

            String use = XmlUtil.getAttributeOrNull(e, Constants.ATTR_USE);
            if (use != null) {
                if (use.equals(Constants.ATTRVALUE_LITERAL)) {
                    body.setUse(SOAPUse.LITERAL);
                } else if (use.equals(Constants.ATTRVALUE_ENCODED)) {
                    body.setUse(SOAPUse.ENCODED);
                } else {
                    Util.fail(
                        "parsing.invalidAttributeValue",
                        Constants.ATTR_USE,
                        use);
                }
            }

            String namespace =
                XmlUtil.getAttributeOrNull(e, Constants.ATTR_NAMESPACE);
            if (namespace != null) {
                body.setNamespace(namespace);
            }

            String encodingStyle =
                XmlUtil.getAttributeOrNull(e, Constants.ATTR_ENCODING_STYLE);
            if (encodingStyle != null) {
                body.setEncodingStyle(encodingStyle);
            }

            String parts = XmlUtil.getAttributeOrNull(e, Constants.ATTR_PARTS);
            if (parts != null) {
                body.setParts(parts);
            }

            parent.addExtension(body);
            context.pop();
//            context.fireDoneParsingEntity(getBodyQName(), body);
            return true;
        } else if (XmlUtil.matchesTagNS(e, getHeaderQName())) {
            return handleHeaderElement(parent, e, context);
        } else {
            Util.fail("parsing.invalidExtensionElement", e.getTagName(), e.getNamespaceURI());
            return false; // keep compiler happy
        }
    }
 
Example 19
Source File: SOAPExtensionHandler.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
private void handleHeaderFaultElement(Element e, TWSDLParserContextImpl context, SOAPHeader header, String use, Element e2) {
    context.push();
    context.registerNamespaces(e);

    SOAPHeaderFault headerfault = new SOAPHeaderFault(context.getLocation(e));

    String use2 = XmlUtil.getAttributeOrNull(e2, Constants.ATTR_USE);
    if (use2 != null) {
        if (use2.equals(Constants.ATTRVALUE_LITERAL)) {
            headerfault.setUse(SOAPUse.LITERAL);
        } else if (use.equals(Constants.ATTRVALUE_ENCODED)) {
            headerfault.setUse(SOAPUse.ENCODED);
        } else {
            Util.fail("parsing.invalidAttributeValue", Constants.ATTR_USE, use2);
        }
    }

    String namespace2 = XmlUtil.getAttributeOrNull(e2, Constants.ATTR_NAMESPACE);
    if (namespace2 != null) {
        headerfault.setNamespace(namespace2);
    }

    String encodingStyle2 = XmlUtil.getAttributeOrNull(e2, Constants.ATTR_ENCODING_STYLE);
    if (encodingStyle2 != null) {
        headerfault.setEncodingStyle(encodingStyle2);
    }

    String part2 = XmlUtil.getAttributeOrNull(e2, Constants.ATTR_PART);
    if (part2 != null) {
        headerfault.setPart(part2);
    }

    String messageAttr2 = XmlUtil.getAttributeOrNull(e2, Constants.ATTR_MESSAGE);
    if (messageAttr2 != null) {
        headerfault.setMessage(
            context.translateQualifiedName(context.getLocation(e2), messageAttr2));
    }

    header.add(headerfault);
    context.pop();
}
 
Example 20
Source File: SOAPExtensionHandler.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
private boolean handleHeaderElement(TWSDLExtensible parent, Element e, TWSDLParserContextImpl context) {
    context.push();
    context.registerNamespaces(e);

    SOAPHeader header = new SOAPHeader(context.getLocation(e));

    String use = XmlUtil.getAttributeOrNull(e, Constants.ATTR_USE);
    if (use != null) {
        if (use.equals(Constants.ATTRVALUE_LITERAL)) {
            header.setUse(SOAPUse.LITERAL);
        } else if (use.equals(Constants.ATTRVALUE_ENCODED)) {
            header.setUse(SOAPUse.ENCODED);
        } else {
            Util.fail("parsing.invalidAttributeValue", Constants.ATTR_USE, use);
        }
    }

    String namespace = XmlUtil.getAttributeOrNull(e, Constants.ATTR_NAMESPACE);
    if (namespace != null) {
        header.setNamespace(namespace);
    }

    String encodingStyle = XmlUtil.getAttributeOrNull(e, Constants.ATTR_ENCODING_STYLE);
    if (encodingStyle != null) {
        header.setEncodingStyle(encodingStyle);
    }

    String part = XmlUtil.getAttributeOrNull(e, Constants.ATTR_PART);
    if (part != null) {
        header.setPart(part);
    }

    String messageAttr = XmlUtil.getAttributeOrNull(e, Constants.ATTR_MESSAGE);
    if (messageAttr != null) {
        header.setMessage(context.translateQualifiedName(context.getLocation(e), messageAttr));
    }

    for (Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();) {
        Element e2 = Util.nextElement(iter);
        if (e2 == null)
            break;

        if (XmlUtil.matchesTagNS(e2, getHeaderfaultQName())) {
            handleHeaderFaultElement(e, context, header, use, e2);
        } else {
            Util.fail("parsing.invalidElement", e2.getTagName(), e2.getNamespaceURI());
        }
    }

    parent.addExtension(header);
    context.pop();
    context.fireDoneParsingEntity(getHeaderQName(), header);
    return true;
}