com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext Java Examples

The following examples show how to use com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext. 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: MIMEExtensionHandler.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
@Override
    public boolean doHandleExtension(
        TWSDLParserContext context,
        TWSDLExtensible parent,
        Element e) {
        if (parent.getWSDLElementName().equals(WSDLConstants.QNAME_OUTPUT)) {
            return handleInputOutputExtension(context, parent, e);
        } else if (parent.getWSDLElementName().equals(WSDLConstants.QNAME_INPUT)) {
            return handleInputOutputExtension(context, parent, e);
        } else if (parent.getWSDLElementName().equals(MIMEConstants.QNAME_PART)) {
            return handleMIMEPartExtension(context, parent, e);
        } else {
//            context.fireIgnoringExtension(
//                new QName(e.getNamespaceURI(), e.getLocalName()),
//                parent.getWSDLElementName());
            return false;
        }
    }
 
Example #2
Source File: JAXWSBindingExtensionHandler.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@Override
public boolean handleOperationExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
    if(XmlUtil.matchesTagNS(e, JAXWSBindingsConstants.JAXWS_BINDINGS)){
        if(parent instanceof Operation){
            return handlePortTypeOperation(context, (Operation)parent, e);
        }else if(parent instanceof BindingOperation){
            return handleBindingOperation(context, (BindingOperation)parent, e);
        }
    }else {
        Util.fail(
            "parsing.invalidExtensionElement",
            e.getTagName(),
            e.getNamespaceURI());
        return false;
    }
    return false;
}
 
Example #3
Source File: MIMEExtensionHandler.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected boolean handleMIMEPartExtension(
    TWSDLParserContext context,
    TWSDLExtensible parent,
    Element e) {
    if (XmlUtil.matchesTagNS(e, MIMEConstants.QNAME_CONTENT)) {
        MIMEContent content = parseMIMEContent(context, e);
        parent.addExtension(content);
        return true;
    } else if (XmlUtil.matchesTagNS(e, MIMEConstants.QNAME_MIME_XML)) {
        MIMEXml mimeXml = parseMIMEXml(context, e);
        parent.addExtension(mimeXml);
        return true;
    } else {
        Util.fail(
            "parsing.invalidExtensionElement",
            e.getTagName(),
            e.getNamespaceURI());
        return false; // keep compiler happy
    }
}
 
Example #4
Source File: JAXWSBindingExtensionHandler.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param context
 * @param jaxwsBinding
 * @param e
 */
private void parseParameter(com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext context, JAXWSBinding jaxwsBinding, Element e) {
    String part = XmlUtil.getAttributeOrNull(e, JAXWSBindingsConstants.PART_ATTR);
    Element msgPartElm = evaluateXPathNode(e.getOwnerDocument(), part, new NamespaceContextImpl(e));
    Node msgElm = msgPartElm.getParentNode();
    //MessagePart msgPart = new MessagePart();

    String partName = XmlUtil.getAttributeOrNull(msgPartElm, "name");
    String msgName = XmlUtil.getAttributeOrNull((Element)msgElm, "name");
    if ((partName == null) || (msgName == null)) {
        return;
    }

    String element = XmlUtil.getAttributeOrNull(e, JAXWSBindingsConstants.ELEMENT_ATTR);
    String name = XmlUtil.getAttributeOrNull(e, JAXWSBindingsConstants.NAME_ATTR);

    QName elementName = null;
    if(element != null){
        String uri = e.lookupNamespaceURI(XmlUtil.getPrefix(element));
        elementName = (uri == null)?null:new QName(uri, XmlUtil.getLocalPart(element));
    }

    jaxwsBinding.addParameter(new Parameter(msgName, partName, elementName, name));
}
 
Example #5
Source File: HTTPExtensionHandler.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public boolean handleBindingExtension(
        TWSDLParserContext context,
        TWSDLExtensible parent,
        Element e) {
        if (XmlUtil.matchesTagNS(e, HTTPConstants.QNAME_BINDING)) {
            context.push();
            context.registerNamespaces(e);

            HTTPBinding binding = new HTTPBinding(context.getLocation(e));

            String verb = Util.getRequiredAttribute(e, Constants.ATTR_VERB);
            binding.setVerb(verb);

            parent.addExtension(binding);
            context.pop();
//            context.fireDoneParsingEntity(HTTPConstants.QNAME_BINDING, binding);
            return true;
        } else {
            Util.fail(
                "parsing.invalidExtensionElement",
                e.getTagName(),
                e.getNamespaceURI());
            return false;
        }
    }
 
Example #6
Source File: MIMEExtensionHandler.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@Override
    public boolean doHandleExtension(
        TWSDLParserContext context,
        TWSDLExtensible parent,
        Element e) {
        if (parent.getWSDLElementName().equals(WSDLConstants.QNAME_OUTPUT)) {
            return handleInputOutputExtension(context, parent, e);
        } else if (parent.getWSDLElementName().equals(WSDLConstants.QNAME_INPUT)) {
            return handleInputOutputExtension(context, parent, e);
        } else if (parent.getWSDLElementName().equals(MIMEConstants.QNAME_PART)) {
            return handleMIMEPartExtension(context, parent, e);
        } else {
//            context.fireIgnoringExtension(
//                new QName(e.getNamespaceURI(), e.getLocalName()),
//                parent.getWSDLElementName());
            return false;
        }
    }
 
Example #7
Source File: MIMEExtensionHandler.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
@Override
    public boolean doHandleExtension(
        TWSDLParserContext context,
        TWSDLExtensible parent,
        Element e) {
        if (parent.getWSDLElementName().equals(WSDLConstants.QNAME_OUTPUT)) {
            return handleInputOutputExtension(context, parent, e);
        } else if (parent.getWSDLElementName().equals(WSDLConstants.QNAME_INPUT)) {
            return handleInputOutputExtension(context, parent, e);
        } else if (parent.getWSDLElementName().equals(MIMEConstants.QNAME_PART)) {
            return handleMIMEPartExtension(context, parent, e);
        } else {
//            context.fireIgnoringExtension(
//                new QName(e.getNamespaceURI(), e.getLocalName()),
//                parent.getWSDLElementName());
            return false;
        }
    }
 
Example #8
Source File: MIMEExtensionHandler.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
protected MIMEContent parseMIMEContent(TWSDLParserContext context, Element e) {
        context.push();
        context.registerNamespaces(e);

        MIMEContent content = new MIMEContent(context.getLocation(e));

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

        String type = XmlUtil.getAttributeOrNull(e, Constants.ATTR_TYPE);
        if (type != null) {
            content.setType(type);
        }

        context.pop();
//        context.fireDoneParsingEntity(MIMEConstants.QNAME_CONTENT, content);
        return content;
    }
 
Example #9
Source File: MemberSubmissionAddressingExtensionHandler.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean handleOutputExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
    if (extensionModeOn) {
        warn(context.getLocation(e));
        String actionValue = XmlUtil.getAttributeNSOrNull(e, WSA_ACTION_QNAME);
        if (actionValue == null || actionValue.equals("")) {
            return warnEmptyAction(parent, context.getLocation(e));
        }
        ((Output) parent).setAction(actionValue);
        return true;
    } else {
        return fail(context.getLocation(e));
    }
}
 
Example #10
Source File: SOAPExtensionHandler.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public boolean handleTypesExtension(
    com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext context,
    TWSDLExtensible parent,
    Element e) {
    Util.fail(
        "parsing.invalidExtensionElement",
        e.getTagName(),
        e.getNamespaceURI());
    return false; // keep compiler happy
}
 
Example #11
Source File: MemberSubmissionAddressingExtensionHandler.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean handleFaultExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
    if (extensionModeOn) {
        warn(context.getLocation(e));
        String actionValue = XmlUtil.getAttributeNSOrNull(e, WSA_ACTION_QNAME);
        if (actionValue == null || actionValue.equals("")) {
            errReceiver.warning(context.getLocation(e), WsdlMessages.WARNING_FAULT_EMPTY_ACTION(parent.getNameValue(), parent.getWSDLElementName().getLocalPart(), parent.getParent().getNameValue()));
            return false; // keep compiler happy
        }
        ((Fault) parent).setAction(actionValue);
        return true;
    } else {
        return fail(context.getLocation(e));
    }
}
 
Example #12
Source File: MemberSubmissionAddressingExtensionHandler.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean handleInputExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
    if (extensionModeOn) {
        warn(context.getLocation(e));
        String actionValue = XmlUtil.getAttributeNSOrNull(e, WSA_ACTION_QNAME);
        if (actionValue == null || actionValue.equals("")) {
            return warnEmptyAction(parent, context.getLocation(e));
        }
        ((Input) parent).setAction(actionValue);
        return true;
    } else {
        return fail(context.getLocation(e));
    }
}
 
Example #13
Source File: HTTPExtensionHandler.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public boolean handleTypesExtension(
    com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext context,
    TWSDLExtensible parent,
    Element e) {
    Util.fail(
        "parsing.invalidExtensionElement",
        e.getTagName(),
        e.getNamespaceURI());
    return false;
}
 
Example #14
Source File: SOAPExtensionHandler.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected boolean handleMIMEPartExtension(
    TWSDLParserContext context,
    TWSDLExtensible parent,
    Element e) {
    return handleInputOutputExtension(context, parent, e);
}
 
Example #15
Source File: W3CAddressingMetadataExtensionHandler.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean handleInputExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
    String actionValue = XmlUtil.getAttributeNSOrNull(e, WSAM_ACTION_QNAME);
    if (actionValue == null || actionValue.equals("")) {
        return warnEmptyAction(parent, context.getLocation(e));
    }
    ((Input)parent).setAction(actionValue);
    return true;
}
 
Example #16
Source File: SOAPExtensionHandler.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public boolean handleTypesExtension(
    com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext context,
    TWSDLExtensible parent,
    Element e) {
    Util.fail(
        "parsing.invalidExtensionElement",
        e.getTagName(),
        e.getNamespaceURI());
    return false; // keep compiler happy
}
 
Example #17
Source File: SOAPExtensionHandler.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
    public boolean handlePortExtension(
        TWSDLParserContext context,
        TWSDLExtensible parent,
        Element e) {
        if (XmlUtil.matchesTagNS(e, getAddressQName())) {
            context.push();
            context.registerNamespaces(e);

            SOAPAddress address = new SOAPAddress(context.getLocation(e));

            String location =
                Util.getRequiredAttribute(e, Constants.ATTR_LOCATION);
            address.setLocation(location);

            parent.addExtension(address);
            context.pop();
//            context.fireDoneParsingEntity(getAddressQName(), address);
            return true;
        } else {
            Util.fail(
                "parsing.invalidExtensionElement",
                e.getTagName(),
                e.getNamespaceURI());
            return false; // keep compiler happy
        }
    }
 
Example #18
Source File: JAXWSBindingExtensionHandler.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
    public boolean handleFaultExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
        if(XmlUtil.matchesTagNS(e, JAXWSBindingsConstants.JAXWS_BINDINGS)){
            context.push();
            context.registerNamespaces(e);
            JAXWSBinding jaxwsBinding = new JAXWSBinding(context.getLocation(e));

            for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){
                Element e2 = Util.nextElement(iter);
                if (e2 == null) {
                    break;
                }
                if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.CLASS)){
                    parseClass(context, jaxwsBinding, e2);
                    if((jaxwsBinding.getClassName() != null) && (jaxwsBinding.getClassName().getJavaDoc() != null)){
                        ((Fault)parent).setDocumentation(new Documentation(jaxwsBinding.getClassName().getJavaDoc()));
                    }
                }else{
                    Util.fail(
                        "parsing.invalidExtensionElement",
                        e2.getTagName(),
                        e2.getNamespaceURI());
                    return false;
                }
            }
            parent.addExtension(jaxwsBinding);
            context.pop();
//            context.fireDoneParsingEntity(
//                    JAXWSBindingsConstants.JAXWS_BINDINGS,
//                    jaxwsBinding);
            return true;
        }else {
            Util.fail(
                "parsing.invalidExtensionElement",
                e.getTagName(),
                e.getNamespaceURI());
            return false;
        }
    }
 
Example #19
Source File: JAXWSBindingExtensionHandler.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param context
 * @param parent
 * @param e
 */
private void parseMimeContent(com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext context, JAXWSBinding parent, Element e) {
    //System.out.println("In handleMimeContentExtension: " + e.getNodeName());
    String val = e.getTextContent();
    if (val == null) {
        return;
    }
    if (val.equals("false") || val.equals("0")) {
        ((JAXWSBinding) parent).setEnableMimeContentMapping(Boolean.FALSE);
    } else if (val.equals("true") || val.equals("1")) {
        ((JAXWSBinding) parent).setEnableMimeContentMapping(Boolean.TRUE);
    }
}
 
Example #20
Source File: SOAPExtensionHandler.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public boolean handleServiceExtension(
    TWSDLParserContext context,
    TWSDLExtensible parent,
    Element e) {
    Util.fail(
        "parsing.invalidExtensionElement",
        e.getTagName(),
        e.getNamespaceURI());
    return false; // keep compiler happy
}
 
Example #21
Source File: JAXWSBindingExtensionHandler.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param context
 * @param parent
 * @param e
 */
private void parseAsynMapping(com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext context, JAXWSBinding parent, Element e) {
    //System.out.println("In handleAsynMappingExtension: " + e.getNodeName());
    String val = e.getTextContent();
    if (val == null) {
        return;
    }
    if (val.equals("false") || val.equals("0")) {
        ((JAXWSBinding) parent).setEnableAsyncMapping(Boolean.FALSE);
    } else if (val.equals("true") || val.equals("1")) {
        ((JAXWSBinding) parent).setEnableAsyncMapping(Boolean.TRUE);
    }
}
 
Example #22
Source File: HTTPExtensionHandler.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public boolean handleDefinitionsExtension(
    TWSDLParserContext context,
    TWSDLExtensible parent,
    Element e) {
    Util.fail(
        "parsing.invalidExtensionElement",
        e.getTagName(),
        e.getNamespaceURI());
    return false;
}
 
Example #23
Source File: HTTPExtensionHandler.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public boolean handleDefinitionsExtension(
    TWSDLParserContext context,
    TWSDLExtensible parent,
    Element e) {
    Util.fail(
        "parsing.invalidExtensionElement",
        e.getTagName(),
        e.getNamespaceURI());
    return false;
}
 
Example #24
Source File: HTTPExtensionHandler.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public boolean handleTypesExtension(
    com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext context,
    TWSDLExtensible parent,
    Element e) {
    Util.fail(
        "parsing.invalidExtensionElement",
        e.getTagName(),
        e.getNamespaceURI());
    return false;
}
 
Example #25
Source File: HTTPExtensionHandler.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public boolean handleFaultExtension(
    TWSDLParserContext context,
    TWSDLExtensible parent,
    Element e) {
    Util.fail(
        "parsing.invalidExtensionElement",
        e.getTagName(),
        e.getNamespaceURI());
    return false;
}
 
Example #26
Source File: HTTPExtensionHandler.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public boolean handleServiceExtension(
    TWSDLParserContext context,
    TWSDLExtensible parent,
    Element e) {
    Util.fail(
        "parsing.invalidExtensionElement",
        e.getTagName(),
        e.getNamespaceURI());
    return false;
}
 
Example #27
Source File: SOAPExtensionHandler.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public boolean handleDefinitionsExtension(
    TWSDLParserContext context,
    TWSDLExtensible parent,
    Element e) {
    Util.fail(
        "parsing.invalidExtensionElement",
        e.getTagName(),
        e.getNamespaceURI());
    return false; // keep compiler happy
}
 
Example #28
Source File: HTTPExtensionHandler.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public boolean handlePortTypeExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
    Util.fail(
        "parsing.invalidExtensionElement",
        e.getTagName(),
        e.getNamespaceURI());
    return false;
}
 
Example #29
Source File: W3CAddressingMetadataExtensionHandler.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean handleFaultExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
    String actionValue = XmlUtil.getAttributeNSOrNull(e, WSAM_ACTION_QNAME);
    if (actionValue == null || actionValue.equals("")) {
        errReceiver.warning(context.getLocation(e), WsdlMessages.WARNING_FAULT_EMPTY_ACTION(parent.getNameValue(), parent.getWSDLElementName().getLocalPart(), parent.getParent().getNameValue()));
        return false; // keep compiler happy
    }
    ((Fault)parent).setAction(actionValue);
    return true;
}
 
Example #30
Source File: SOAPExtensionHandler.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected boolean handleMIMEPartExtension(
    TWSDLParserContext context,
    TWSDLExtensible parent,
    Element e) {
    return handleInputOutputExtension(context, parent, e);
}