Search in sources :

Example 6 with JAXWSBinding

use of com.sun.tools.ws.wsdl.document.jaxws.JAXWSBinding in project metro-jax-ws by eclipse-ee4j.

the class WSDLModeler method setCustomizedParameterName.

/**
 * @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);
    }
}
Also used : QName(javax.xml.namespace.QName) JAXWSBinding(com.sun.tools.ws.wsdl.document.jaxws.JAXWSBinding)

Example 7 with JAXWSBinding

use of com.sun.tools.ws.wsdl.document.jaxws.JAXWSBinding in project metro-jax-ws by eclipse-ee4j.

the class JAXWSBindingExtensionHandler method handlePortExtension.

@Override
public boolean handlePortExtension(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.PROVIDER)) {
                parseProvider(context, jaxwsBinding, e2);
            } else if (XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.METHOD)) {
                parseMethod(context, jaxwsBinding, e2);
                if ((jaxwsBinding.getMethodName() != null) && (jaxwsBinding.getMethodName().getJavaDoc() != null)) {
                    ((Port) parent).setDocumentation(new Documentation(jaxwsBinding.getMethodName().getJavaDoc()));
                }
            } else {
                Util.fail("parsing.invalidExtensionElement", e2.getTagName(), e2.getNamespaceURI());
                return false;
            }
        }
        parent.addExtension(jaxwsBinding);
        context.pop();
        // jaxwsBinding);
        return true;
    } else {
        Util.fail("parsing.invalidExtensionElement", e.getTagName(), e.getNamespaceURI());
        return false;
    }
}
Also used : Element(org.w3c.dom.Element) Iterator(java.util.Iterator) JAXWSBinding(com.sun.tools.ws.wsdl.document.jaxws.JAXWSBinding)

Example 8 with JAXWSBinding

use of com.sun.tools.ws.wsdl.document.jaxws.JAXWSBinding in project metro-jax-ws by eclipse-ee4j.

the class JAXWSBindingExtensionHandler method handleBindingExtension.

@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;
            }
            // }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();
        // jaxwsBinding);
        return true;
    } else {
        Util.fail("parsing.invalidExtensionElement", e.getTagName(), e.getNamespaceURI());
        return false;
    }
}
Also used : Element(org.w3c.dom.Element) Iterator(java.util.Iterator) JAXWSBinding(com.sun.tools.ws.wsdl.document.jaxws.JAXWSBinding)

Example 9 with JAXWSBinding

use of com.sun.tools.ws.wsdl.document.jaxws.JAXWSBinding in project metro-jax-ws by eclipse-ee4j.

the class JAXWSBindingExtensionHandler method handlePortTypeExtension.

@Override
public boolean handlePortTypeExtension(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_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.CLASS)) {
                parseClass(context, jaxwsBinding, e2);
                if ((jaxwsBinding.getClassName() != null) && (jaxwsBinding.getClassName().getJavaDoc() != null) && (parent instanceof PortType)) {
                    ((PortType) parent).setDocumentation(new Documentation(jaxwsBinding.getClassName().getJavaDoc()));
                }
            } else {
                Util.fail("parsing.invalidExtensionElement", e2.getTagName(), e2.getNamespaceURI());
                return false;
            }
        }
        parent.addExtension(jaxwsBinding);
        context.pop();
        // jaxwsBinding);
        return true;
    } else {
        Util.fail("parsing.invalidExtensionElement", e.getTagName(), e.getNamespaceURI());
        return false;
    }
}
Also used : Element(org.w3c.dom.Element) Iterator(java.util.Iterator) JAXWSBinding(com.sun.tools.ws.wsdl.document.jaxws.JAXWSBinding)

Example 10 with JAXWSBinding

use of com.sun.tools.ws.wsdl.document.jaxws.JAXWSBinding in project metro-jax-ws by eclipse-ee4j.

the class JAXWSBindingExtensionHandler method handlePortTypeOperation.

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();
    // jaxwsBinding);
    return true;
}
Also used : Element(org.w3c.dom.Element) Iterator(java.util.Iterator) JAXWSBinding(com.sun.tools.ws.wsdl.document.jaxws.JAXWSBinding)

Aggregations

JAXWSBinding (com.sun.tools.ws.wsdl.document.jaxws.JAXWSBinding)21 Iterator (java.util.Iterator)8 Element (org.w3c.dom.Element)8 CustomName (com.sun.tools.ws.wsdl.document.jaxws.CustomName)3 QName (javax.xml.namespace.QName)2 com.sun.tools.ws.wsdl.document (com.sun.tools.ws.wsdl.document)1