com.sun.tools.internal.ws.wsdl.document.jaxws.JAXWSBinding Java Examples

The following examples show how to use com.sun.tools.internal.ws.wsdl.document.jaxws.JAXWSBinding. 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: WSDLModeler.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
private boolean applyOperationNameCustomization() {
    JAXWSBinding jaxwsCustomization = (JAXWSBinding) getExtensionOfType(info.portTypeOperation, JAXWSBinding.class);
    String operationName = (jaxwsCustomization != null) ? ((jaxwsCustomization.getMethodName() != null) ? jaxwsCustomization.getMethodName().getName() : null) : null;
    if (operationName != null) {
        if (Names.isJavaReservedWord(operationName)) {
            if (options.isExtensionMode()) {
                warning(info.portTypeOperation, ModelerMessages.WSDLMODELER_WARNING_IGNORING_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_CUSTOMIZED_OPERATION_NAME(info.operation.getName(), operationName));
            } else {
                error(info.portTypeOperation, ModelerMessages.WSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_CUSTOMIZED_OPERATION_NAME(info.operation.getName(), operationName));
            }
            return false;
        }

        info.operation.setCustomizedName(operationName);
    }

    if (Names.isJavaReservedWord(info.operation.getJavaMethodName())) {
        if (options.isExtensionMode()) {
            warning(info.portTypeOperation, ModelerMessages.WSDLMODELER_WARNING_IGNORING_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_OPERATION_NAME(info.operation.getName()));
        } else {
            error(info.portTypeOperation, ModelerMessages.WSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_OPERATION_NAME(info.operation.getName()));
        }
        return false;
    }
    return true;
}
 
Example #2
Source File: WSDLModelerBase.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 * @param port
 * @param wsdlPort
 */
protected void applyPortMethodCustomization(Port port, com.sun.tools.internal.ws.wsdl.document.Port wsdlPort) {
    if (isProvider(wsdlPort)) {
        return;
    }
    JAXWSBinding jaxwsBinding = (JAXWSBinding)getExtensionOfType(wsdlPort, JAXWSBinding.class);

    String portMethodName = (jaxwsBinding != null)?((jaxwsBinding.getMethodName() != null)?jaxwsBinding.getMethodName().getName():null):null;
    if(portMethodName != null){
        port.setPortGetter(portMethodName);
    }else{
        portMethodName = Names.getPortName(port);
        portMethodName = BindingHelper.mangleNameToClassName(portMethodName);
        port.setPortGetter("get"+portMethodName);
    }

}
 
Example #3
Source File: WSDLModeler.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param part
 * @param param
 * @param wrapperStyle TODO
 */
private void setCustomizedParameterName(TWSDLExtensible extension, Message msg, MessagePart part, Parameter param, boolean wrapperStyle) {
    JAXWSBinding jaxwsBinding = (JAXWSBinding) getExtensionOfType(extension, JAXWSBinding.class);
    if (jaxwsBinding == null) {
        return;
    }
    String paramName = part.getName();
    QName elementName = part.getDescriptor();
    if (wrapperStyle) {
        elementName = param.getType().getName();
    }
    String customName = jaxwsBinding.getParameterName(msg.getName(), paramName, elementName, wrapperStyle);
    if (customName != null && !customName.equals("")) {
        param.setCustomName(customName);
    }
}
 
Example #4
Source File: WSDLModeler.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
private boolean applyOperationNameCustomization() {
    JAXWSBinding jaxwsCustomization = (JAXWSBinding) getExtensionOfType(info.portTypeOperation, JAXWSBinding.class);
    String operationName = (jaxwsCustomization != null) ? ((jaxwsCustomization.getMethodName() != null) ? jaxwsCustomization.getMethodName().getName() : null) : null;
    if (operationName != null) {
        if (Names.isJavaReservedWord(operationName)) {
            if (options.isExtensionMode()) {
                warning(info.portTypeOperation, ModelerMessages.WSDLMODELER_WARNING_IGNORING_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_CUSTOMIZED_OPERATION_NAME(info.operation.getName(), operationName));
            } else {
                error(info.portTypeOperation, ModelerMessages.WSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_CUSTOMIZED_OPERATION_NAME(info.operation.getName(), operationName));
            }
            return false;
        }

        info.operation.setCustomizedName(operationName);
    }

    if (Names.isJavaReservedWord(info.operation.getJavaMethodName())) {
        if (options.isExtensionMode()) {
            warning(info.portTypeOperation, ModelerMessages.WSDLMODELER_WARNING_IGNORING_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_OPERATION_NAME(info.operation.getName()));
        } else {
            error(info.portTypeOperation, ModelerMessages.WSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_OPERATION_NAME(info.operation.getName()));
        }
        return false;
    }
    return true;
}
 
Example #5
Source File: WSDLModeler.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
private boolean applyOperationNameCustomization() {
    JAXWSBinding jaxwsCustomization = (JAXWSBinding) getExtensionOfType(info.portTypeOperation, JAXWSBinding.class);
    String operationName = (jaxwsCustomization != null) ? ((jaxwsCustomization.getMethodName() != null) ? jaxwsCustomization.getMethodName().getName() : null) : null;
    if (operationName != null) {
        if (Names.isJavaReservedWord(operationName)) {
            if (options.isExtensionMode()) {
                warning(info.portTypeOperation, ModelerMessages.WSDLMODELER_WARNING_IGNORING_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_CUSTOMIZED_OPERATION_NAME(info.operation.getName(), operationName));
            } else {
                error(info.portTypeOperation, ModelerMessages.WSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_CUSTOMIZED_OPERATION_NAME(info.operation.getName(), operationName));
            }
            return false;
        }

        info.operation.setCustomizedName(operationName);
    }

    if (Names.isJavaReservedWord(info.operation.getJavaMethodName())) {
        if (options.isExtensionMode()) {
            warning(info.portTypeOperation, ModelerMessages.WSDLMODELER_WARNING_IGNORING_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_OPERATION_NAME(info.operation.getName()));
        } else {
            error(info.portTypeOperation, ModelerMessages.WSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_OPERATION_NAME(info.operation.getName()));
        }
        return false;
    }
    return true;
}
 
Example #6
Source File: WSDLModeler.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
private boolean applyOperationNameCustomization() {
    JAXWSBinding jaxwsCustomization = (JAXWSBinding) getExtensionOfType(info.portTypeOperation, JAXWSBinding.class);
    String operationName = (jaxwsCustomization != null) ? ((jaxwsCustomization.getMethodName() != null) ? jaxwsCustomization.getMethodName().getName() : null) : null;
    if (operationName != null) {
        if (Names.isJavaReservedWord(operationName)) {
            if (options.isExtensionMode()) {
                warning(info.portTypeOperation, ModelerMessages.WSDLMODELER_WARNING_IGNORING_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_CUSTOMIZED_OPERATION_NAME(info.operation.getName(), operationName));
            } else {
                error(info.portTypeOperation, ModelerMessages.WSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_CUSTOMIZED_OPERATION_NAME(info.operation.getName(), operationName));
            }
            return false;
        }

        info.operation.setCustomizedName(operationName);
    }

    if (Names.isJavaReservedWord(info.operation.getJavaMethodName())) {
        if (options.isExtensionMode()) {
            warning(info.portTypeOperation, ModelerMessages.WSDLMODELER_WARNING_IGNORING_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_OPERATION_NAME(info.operation.getName()));
        } else {
            error(info.portTypeOperation, ModelerMessages.WSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_OPERATION_NAME(info.operation.getName()));
        }
        return false;
    }
    return true;
}
 
Example #7
Source File: WSDLModelerBase.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 * @param port
 * @param wsdlPort
 */
protected void applyPortMethodCustomization(Port port, com.sun.tools.internal.ws.wsdl.document.Port wsdlPort) {
    if (isProvider(wsdlPort)) {
        return;
    }
    JAXWSBinding jaxwsBinding = (JAXWSBinding)getExtensionOfType(wsdlPort, JAXWSBinding.class);

    String portMethodName = (jaxwsBinding != null)?((jaxwsBinding.getMethodName() != null)?jaxwsBinding.getMethodName().getName():null):null;
    if(portMethodName != null){
        port.setPortGetter(portMethodName);
    }else{
        portMethodName = Names.getPortName(port);
        portMethodName = BindingHelper.mangleNameToClassName(portMethodName);
        port.setPortGetter("get"+portMethodName);
    }

}
 
Example #8
Source File: WSDLModeler.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param part
 * @param param
 * @param wrapperStyle TODO
 */
private void setCustomizedParameterName(TWSDLExtensible extension, Message msg, MessagePart part, Parameter param, boolean wrapperStyle) {
    JAXWSBinding jaxwsBinding = (JAXWSBinding) getExtensionOfType(extension, JAXWSBinding.class);
    if (jaxwsBinding == null) {
        return;
    }
    String paramName = part.getName();
    QName elementName = part.getDescriptor();
    if (wrapperStyle) {
        elementName = param.getType().getName();
    }
    String customName = jaxwsBinding.getParameterName(msg.getName(), paramName, elementName, wrapperStyle);
    if (customName != null && !customName.equals("")) {
        param.setCustomName(customName);
    }
}
 
Example #9
Source File: WSDLModelerBase.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 * @param port
 * @param wsdlPort
 */
protected void applyPortMethodCustomization(Port port, com.sun.tools.internal.ws.wsdl.document.Port wsdlPort) {
    if (isProvider(wsdlPort)) {
        return;
    }
    JAXWSBinding jaxwsBinding = (JAXWSBinding)getExtensionOfType(wsdlPort, JAXWSBinding.class);

    String portMethodName = (jaxwsBinding != null)?((jaxwsBinding.getMethodName() != null)?jaxwsBinding.getMethodName().getName():null):null;
    if(portMethodName != null){
        port.setPortGetter(portMethodName);
    }else{
        portMethodName = Names.getPortName(port);
        portMethodName = BindingHelper.mangleNameToClassName(portMethodName);
        port.setPortGetter("get"+portMethodName);
    }

}
 
Example #10
Source File: WSDLModeler.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
private boolean applyOperationNameCustomization() {
    JAXWSBinding jaxwsCustomization = (JAXWSBinding) getExtensionOfType(info.portTypeOperation, JAXWSBinding.class);
    String operationName = (jaxwsCustomization != null) ? ((jaxwsCustomization.getMethodName() != null) ? jaxwsCustomization.getMethodName().getName() : null) : null;
    if (operationName != null) {
        if (Names.isJavaReservedWord(operationName)) {
            if (options.isExtensionMode()) {
                warning(info.portTypeOperation, ModelerMessages.WSDLMODELER_WARNING_IGNORING_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_CUSTOMIZED_OPERATION_NAME(info.operation.getName(), operationName));
            } else {
                error(info.portTypeOperation, ModelerMessages.WSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_CUSTOMIZED_OPERATION_NAME(info.operation.getName(), operationName));
            }
            return false;
        }

        info.operation.setCustomizedName(operationName);
    }

    if (Names.isJavaReservedWord(info.operation.getJavaMethodName())) {
        if (options.isExtensionMode()) {
            warning(info.portTypeOperation, ModelerMessages.WSDLMODELER_WARNING_IGNORING_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_OPERATION_NAME(info.operation.getName()));
        } else {
            error(info.portTypeOperation, ModelerMessages.WSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_OPERATION_NAME(info.operation.getName()));
        }
        return false;
    }
    return true;
}
 
Example #11
Source File: WSDLModeler.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param part
 * @param param
 * @param wrapperStyle TODO
 */
private void setCustomizedParameterName(TWSDLExtensible extension, Message msg, MessagePart part, Parameter param, boolean wrapperStyle) {
    JAXWSBinding jaxwsBinding = (JAXWSBinding) getExtensionOfType(extension, JAXWSBinding.class);
    if (jaxwsBinding == null) {
        return;
    }
    String paramName = part.getName();
    QName elementName = part.getDescriptor();
    if (wrapperStyle) {
        elementName = param.getType().getName();
    }
    String customName = jaxwsBinding.getParameterName(msg.getName(), paramName, elementName, wrapperStyle);
    if (customName != null && !customName.equals("")) {
        param.setCustomName(customName);
    }
}
 
Example #12
Source File: WSDLModeler.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param part
 * @param param
 * @param wrapperStyle TODO
 */
private void setCustomizedParameterName(TWSDLExtensible extension, Message msg, MessagePart part, Parameter param, boolean wrapperStyle) {
    JAXWSBinding jaxwsBinding = (JAXWSBinding) getExtensionOfType(extension, JAXWSBinding.class);
    if (jaxwsBinding == null) {
        return;
    }
    String paramName = part.getName();
    QName elementName = part.getDescriptor();
    if (wrapperStyle) {
        elementName = param.getType().getName();
    }
    String customName = jaxwsBinding.getParameterName(msg.getName(), paramName, elementName, wrapperStyle);
    if (customName != null && !customName.equals("")) {
        param.setCustomName(customName);
    }
}
 
Example #13
Source File: JAXWSBindingExtensionHandler.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
    public boolean handleBindingExtension(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.ENABLE_ADDITIONAL_SOAPHEADER_MAPPING)){
//                    parseAdditionalSOAPHeaderMapping(context, jaxwsBinding, e2);
//                }else
                if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_MIME_CONTENT)){
                    parseMimeContent(context, jaxwsBinding, e2);
                }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 #14
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 parseProvider(com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext context, JAXWSBinding parent, Element e) {
    String val = e.getTextContent();
    if (val == null) {
        return;
    }
    if (val.equals("false") || val.equals("0")) {
        ((JAXWSBinding)parent).setProvider(Boolean.FALSE);
    } else if(val.equals("true") || val.equals("1")) {
        ((JAXWSBinding)parent).setProvider(Boolean.TRUE);
    }

}
 
Example #15
Source File: JAXWSBindingExtensionHandler.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param context
 * @param parent
 * @param e
 */
private void parsePackage(com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext context, JAXWSBinding parent, Element e) {
    //System.out.println("In handlePackageExtension: " + e.getNodeName());
    String packageName = XmlUtil.getAttributeOrNull(e, JAXWSBindingsConstants.NAME_ATTR);
    JAXWSBinding binding = (JAXWSBinding)parent;
    binding.setJaxwsPackage(new CustomName(packageName, getJavaDoc(e)));
}
 
Example #16
Source File: WSDLModeler.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
protected String getJavaNameOfSEI(Port port) {
    QName portTypeName =
            (QName) port.getProperty(
                    ModelProperties.PROPERTY_WSDL_PORT_TYPE_NAME);
    PortType pt = (PortType) document.find(Kinds.PORT_TYPE, portTypeName);
    //populate the portType map here. We should get rid of all these properties
    // lets not do it as it may break NB
    //TODO: clean all these stuff part of NB RFE
    port.portTypes.put(portTypeName, pt);
    JAXWSBinding jaxwsCust = (JAXWSBinding) getExtensionOfType(pt, JAXWSBinding.class);
    if (jaxwsCust != null && jaxwsCust.getClassName() != null) {
        CustomName name = jaxwsCust.getClassName();
        if (name != null && !name.getName().equals("")) {
            return makePackageQualified(name.getName());
        }
    }

    String interfaceName;
    if (portTypeName != null) {
        // got portType information from WSDL, use it to name the interface
        interfaceName =
                makePackageQualified(BindingHelper.mangleNameToClassName(portTypeName.getLocalPart()));
    } else {
        // somehow we only got the port name, so we use that
        interfaceName =
                makePackageQualified(BindingHelper.mangleNameToClassName(port.getName().getLocalPart()));
    }
    return interfaceName;
}
 
Example #17
Source File: JAXWSBindingExtensionHandler.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
    public boolean handleBindingExtension(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.ENABLE_ADDITIONAL_SOAPHEADER_MAPPING)){
//                    parseAdditionalSOAPHeaderMapping(context, jaxwsBinding, e2);
//                }else
                if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_MIME_CONTENT)){
                    parseMimeContent(context, jaxwsBinding, e2);
                }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 #18
Source File: WSDLModeler.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param port
 */
private void applyWrapperStyleCustomization(Port port, PortType portType) {
    JAXWSBinding jaxwsBinding = (JAXWSBinding) getExtensionOfType(portType, JAXWSBinding.class);
    Boolean wrapperStyle = (jaxwsBinding != null) ? jaxwsBinding.isEnableWrapperStyle() : null;
    if (wrapperStyle != null) {
        port.setWrapped(wrapperStyle);
    }
}
 
Example #19
Source File: JAXWSBindingExtensionHandler.java    From openjdk-8 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: WSDLModeler.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
protected String getServiceInterfaceName(QName serviceQName, com.sun.tools.internal.ws.wsdl.document.Service wsdlService) {
    String serviceName = wsdlService.getName();
    JAXWSBinding jaxwsCust = (JAXWSBinding) getExtensionOfType(wsdlService, JAXWSBinding.class);
    if (jaxwsCust != null && jaxwsCust.getClassName() != null) {
        CustomName name = jaxwsCust.getClassName();
        if (name != null && !name.getName().equals("")) {
            return makePackageQualified(name.getName());
        }
    }
    return makePackageQualified(BindingHelper.mangleNameToClassName(serviceName));
}
 
Example #21
Source File: WSDLModeler.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
protected String getJavaPackage() {
    String jaxwsPackage = null;
    JAXWSBinding jaxwsCustomization = (JAXWSBinding) getExtensionOfType(document.getDefinitions(), JAXWSBinding.class);
    if (jaxwsCustomization != null && jaxwsCustomization.getJaxwsPackage() != null) {
        jaxwsPackage = jaxwsCustomization.getJaxwsPackage().getName();
    }
    if (jaxwsPackage != null) {
        return jaxwsPackage;
    }
    String wsdlUri = document.getDefinitions().getTargetNamespaceURI();
    return XJC.getDefaultPackageName(wsdlUri);

}
 
Example #22
Source File: WSDLModeler.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
protected String getServiceInterfaceName(QName serviceQName, com.sun.tools.internal.ws.wsdl.document.Service wsdlService) {
    String serviceName = wsdlService.getName();
    JAXWSBinding jaxwsCust = (JAXWSBinding) getExtensionOfType(wsdlService, JAXWSBinding.class);
    if (jaxwsCust != null && jaxwsCust.getClassName() != null) {
        CustomName name = jaxwsCust.getClassName();
        if (name != null && !name.getName().equals("")) {
            return makePackageQualified(name.getName());
        }
    }
    return makePackageQualified(BindingHelper.mangleNameToClassName(serviceName));
}
 
Example #23
Source File: WSDLModeler.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private String getFaultClassName(com.sun.tools.internal.ws.wsdl.document.Fault portTypeFault) {
    JAXWSBinding jaxwsBinding = (JAXWSBinding) getExtensionOfType(portTypeFault, JAXWSBinding.class);
    if (jaxwsBinding != null) {
        CustomName className = jaxwsBinding.getClassName();
        if (className != null) {
            return makePackageQualified(className.getName());
        }
    }
    return makePackageQualified(BindingHelper.mangleNameToClassName(portTypeFault.getMessage().getLocalPart()));
}
 
Example #24
Source File: JAXWSBindingExtensionHandler.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private static JAXWSBinding getJAXWSExtension(TWSDLExtensible extensible) {
    for (TWSDLExtension extension:extensible.extensions()) {
        if (extension.getClass().equals(JAXWSBinding.class)) {
            return (JAXWSBinding)extension;
        }
    }

    return null;
}
 
Example #25
Source File: JAXWSBindingExtensionHandler.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param context
 * @param parent
 * @param e
 */
private void parsePackage(com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext context, JAXWSBinding parent, Element e) {
    //System.out.println("In handlePackageExtension: " + e.getNodeName());
    String packageName = XmlUtil.getAttributeOrNull(e, JAXWSBindingsConstants.NAME_ATTR);
    JAXWSBinding binding = (JAXWSBinding)parent;
    binding.setJaxwsPackage(new CustomName(packageName, getJavaDoc(e)));
}
 
Example #26
Source File: WSDLModeler.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param port
 */
private void applyWrapperStyleCustomization(Port port, PortType portType) {
    JAXWSBinding jaxwsBinding = (JAXWSBinding) getExtensionOfType(portType, JAXWSBinding.class);
    Boolean wrapperStyle = (jaxwsBinding != null) ? jaxwsBinding.isEnableWrapperStyle() : null;
    if (wrapperStyle != null) {
        port.setWrapped(wrapperStyle);
    }
}
 
Example #27
Source File: JAXWSBindingExtensionHandler.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private boolean handlePortTypeOperation(TWSDLParserContext context, Operation parent, Element e) {
        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.ENABLE_WRAPPER_STYLE)){
                parseWrapperStyle(context, jaxwsBinding, e2);
            }else if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_ASYNC_MAPPING)){
                parseAsynMapping(context, jaxwsBinding, e2);
            }else if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.METHOD)){
                parseMethod(context, jaxwsBinding, e2);
                if((jaxwsBinding.getMethodName() != null) && (jaxwsBinding.getMethodName().getJavaDoc() != null)){
                    parent.setDocumentation(new Documentation(jaxwsBinding.getMethodName().getJavaDoc()));
                }
            }else if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.PARAMETER)){
                parseParameter(context, jaxwsBinding, e2);
            }else{
                Util.fail(
                    "parsing.invalidExtensionElement",
                    e2.getTagName(),
                    e2.getNamespaceURI());
                return false;
            }
        }
        parent.addExtension(jaxwsBinding);
        context.pop();
//        context.fireDoneParsingEntity(
//                JAXWSBindingsConstants.JAXWS_BINDINGS,
//                jaxwsBinding);
        return true;
    }
 
Example #28
Source File: JAXWSBindingExtensionHandler.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private boolean handlePortTypeOperation(TWSDLParserContext context, Operation parent, Element e) {
        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.ENABLE_WRAPPER_STYLE)){
                parseWrapperStyle(context, jaxwsBinding, e2);
            }else if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_ASYNC_MAPPING)){
                parseAsynMapping(context, jaxwsBinding, e2);
            }else if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.METHOD)){
                parseMethod(context, jaxwsBinding, e2);
                if((jaxwsBinding.getMethodName() != null) && (jaxwsBinding.getMethodName().getJavaDoc() != null)){
                    parent.setDocumentation(new Documentation(jaxwsBinding.getMethodName().getJavaDoc()));
                }
            }else if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.PARAMETER)){
                parseParameter(context, jaxwsBinding, e2);
            }else{
                Util.fail(
                    "parsing.invalidExtensionElement",
                    e2.getTagName(),
                    e2.getNamespaceURI());
                return false;
            }
        }
        parent.addExtension(jaxwsBinding);
        context.pop();
//        context.fireDoneParsingEntity(
//                JAXWSBindingsConstants.JAXWS_BINDINGS,
//                jaxwsBinding);
        return true;
    }
 
Example #29
Source File: JAXWSBindingExtensionHandler.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
    public boolean handleBindingExtension(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.ENABLE_ADDITIONAL_SOAPHEADER_MAPPING)){
//                    parseAdditionalSOAPHeaderMapping(context, jaxwsBinding, e2);
//                }else
                if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_MIME_CONTENT)){
                    parseMimeContent(context, jaxwsBinding, e2);
                }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 #30
Source File: WSDLModeler.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private String getFaultClassName(com.sun.tools.internal.ws.wsdl.document.Fault portTypeFault) {
    JAXWSBinding jaxwsBinding = (JAXWSBinding) getExtensionOfType(portTypeFault, JAXWSBinding.class);
    if (jaxwsBinding != null) {
        CustomName className = jaxwsBinding.getClassName();
        if (className != null) {
            return makePackageQualified(className.getName());
        }
    }
    return makePackageQualified(BindingHelper.mangleNameToClassName(portTypeFault.getMessage().getLocalPart()));
}