Search in sources :

Example 11 with JAXWSBinding

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

the class PseudoSchemaBuilder method getCustomizedOperationName.

private String getCustomizedOperationName(Operation operation) {
    JAXWSBinding jaxwsCustomization = (JAXWSBinding) WSDLModelerBase.getExtensionOfType(operation, JAXWSBinding.class);
    String operationName = (jaxwsCustomization != null) ? ((jaxwsCustomization.getMethodName() != null) ? jaxwsCustomization.getMethodName().getName() : null) : null;
    if (operationName != null) {
        if (Names.isJavaReservedWord(operationName)) {
            return null;
        }
        return operationName;
    }
    return operation.getName();
}
Also used : JAXWSBinding(com.sun.tools.ws.wsdl.document.jaxws.JAXWSBinding)

Example 12 with JAXWSBinding

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

the class WSDLModeler method applyOperationNameCustomization.

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;
}
Also used : JAXWSBinding(com.sun.tools.ws.wsdl.document.jaxws.JAXWSBinding)

Example 13 with JAXWSBinding

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

the class JAXWSBindingExtensionHandler method handleFaultExtension.

/* (non-Javadoc)
     * @see ExtensionHandlerBase#handleFaultExtension(TWSDLParserContextImpl, TWSDLExtensible, org.w3c.dom.Element)
     */
@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();
        // 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 14 with JAXWSBinding

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

the class JAXWSBindingExtensionHandler method parsePackage.

/**
 */
private void parsePackage(com.sun.tools.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 = parent;
    binding.setJaxwsPackage(new CustomName(packageName, getJavaDoc(e)));
}
Also used : CustomName(com.sun.tools.ws.wsdl.document.jaxws.CustomName) JAXWSBinding(com.sun.tools.ws.wsdl.document.jaxws.JAXWSBinding)

Example 15 with JAXWSBinding

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

the class JAXWSBindingExtensionHandler method handleBindingOperation.

private boolean handleBindingOperation(TWSDLParserContext context, BindingOperation operation, 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 if (XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.PARAMETER)) {
                parseParameter(context, jaxwsBinding, e2);
            } else {
                Util.fail("parsing.invalidExtensionElement", e2.getTagName(), e2.getNamespaceURI());
                return false;
            }
        }
        operation.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)

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