Package javax.wsdl

Examples of javax.wsdl.QName


     */
    private static Vector processAllNode(Node allNode, SymbolTable symbolTable) {
        Vector v = new Vector();
        NodeList children = allNode.getChildNodes();
        for (int j = 0; j < children.getLength(); j++) {
            QName subNodeKind = Utils.getNodeQName(children.item(j));
            if (subNodeKind != null &&
                Constants.isSchemaXSD(subNodeKind.getNamespaceURI())) {
                if (subNodeKind.getLocalPart().equals("element")) {
                    ElementDecl elem =
                            processChildElementNode(children.item(j),
                                                    symbolTable);
                    if (elem != null)
                        v.add(elem);
View Full Code Here


    private static ElementDecl processChildElementNode(Node elementNode,
                                                  SymbolTable symbolTable) {
        // Get the name and type qnames.
        // The type qname is used to locate the TypeEntry, which is then
        // used to retrieve the proper java name of the type.
        QName nodeName = Utils.getNodeNameQName(elementNode);
        BooleanHolder forElement = new BooleanHolder();
        QName nodeType = Utils.getNodeTypeRefQName(elementNode, forElement);


        // An element inside a complex type is either qualified or unqualified.
        // If the ref= attribute is used, the name of the ref'd element is used
        // (which must be a root element).  If the ref= attribute is not
        // used, the name of the element is unqualified.

        if (!forElement.value) {
            // check the Form (or elementFormDefault) attribute of this node to
            // determine if it should be namespace quailfied or not.
            String form = Utils.getAttribute(elementNode, "form");
            if (form != null && form.equals("unqualified")) {
                // Unqualified nodeName
                nodeName = new QName("", nodeName.getLocalPart());           
            } else if (form == null) {
                // check elementForDefault on schema element
                String def = Utils.getScopedAttribute(elementNode,
                                                      "elementFormDefault");
                if (def == null || def.equals("unqualified")) {
                    // Unqualified nodeName
                    nodeName = new QName("", nodeName.getLocalPart());           
                }
            }
        } else {
            nodeName = nodeType;
        }
View Full Code Here

    /**
     * Returns the WSDL2Java QName for the anonymous type of the element
     * or null.
     */
    public static QName getElementAnonQName(Node node) {
        QName nodeKind = Utils.getNodeQName(node);
        if (nodeKind != null &&
            nodeKind.getLocalPart().equals("element") &&
            Constants.isSchemaXSD(nodeKind.getNamespaceURI())) {
            NodeList children = node.getChildNodes();
            for (int j = 0; j < children.getLength(); j++) {
                QName kind = Utils.getNodeQName(children.item(j));
                if (kind != null &&
                    (kind.getLocalPart().equals("complexType") ||
                     kind.getLocalPart().equals("simpleType")) &&
                    Constants.isSchemaXSD(kind.getNamespaceURI())) {
                    return Utils.getNodeNameQName(children.item(j));
                }
            }
        }
        return null;
View Full Code Here

        if (node == null) {
            return false;
        }

        // If the node kind is an element, dive into it.
        QName nodeKind = Utils.getNodeQName(node);
        if (nodeKind != null &&
            nodeKind.getLocalPart().equals("element") &&
            Constants.isSchemaXSD(nodeKind.getNamespaceURI())) {
            NodeList children = node.getChildNodes();
            Node complexNode = null;
            for (int j = 0; j < children.getLength() && complexNode == null; j++) {
                QName kind = Utils.getNodeQName(children.item(j));
                if (kind != null &&
                    kind.getLocalPart().equals("complexType") &&
                    Constants.isSchemaXSD(kind.getNamespaceURI())) {
                    complexNode = children.item(j);
                    node = complexNode;
                }
                if (kind != null &&
                    kind.getLocalPart().equals("simpleType") &&
                    Constants.isSchemaXSD(kind.getNamespaceURI())) {
                    return true;
                }
            }
        }

        // Expecting a schema complexType or simpleType
        nodeKind = Utils.getNodeQName(node);
        if (nodeKind != null &&
            nodeKind.getLocalPart().equals("simpleType") &&
            Constants.isSchemaXSD(nodeKind.getNamespaceURI())) {
            return true;
        }

        if (nodeKind != null &&
            nodeKind.getLocalPart().equals("complexType") &&
            Constants.isSchemaXSD(nodeKind.getNamespaceURI())) {

            // Under the complexType there could be complexContent/simpleContent
            // and extension elements if this is a derived type.  Skip over these.
            NodeList children = node.getChildNodes();
            Node complexContent = null;
            Node simpleContent = null;
            Node extension = null;
            for (int j = 0; j < children.getLength() && complexContent == null; j++) {
                QName complexContentKind = Utils.getNodeQName(children.item(j));
                if (complexContentKind != null &&
                    Constants.isSchemaXSD(complexContentKind.getNamespaceURI())) {
                    if (complexContentKind.getLocalPart().equals("complexContent") )
                        complexContent = children.item(j);
                    else if (complexContentKind.getLocalPart().equals("simpleContent"))
                        simpleContent = children.item(j);
                }
            }
            if (complexContent != null) {
                return false;
View Full Code Here

        if (node == null) {
            return null;
        }

        // If the node kind is an element, dive into it.
        QName nodeKind = Utils.getNodeQName(node);
        if (nodeKind != null &&
            nodeKind.getLocalPart().equals("element") &&
            Constants.isSchemaXSD(nodeKind.getNamespaceURI())) {
            NodeList children = node.getChildNodes();
            Node complexNode = null;
            for (int j = 0; j < children.getLength() && complexNode == null; j++) {
                QName complexKind = Utils.getNodeQName(children.item(j));
                if (complexKind != null &&
                    complexKind.getLocalPart().equals("complexType") &&
                    Constants.isSchemaXSD(complexKind.getNamespaceURI())) {
                    complexNode = children.item(j);
                    node = complexNode;
                }
            }
        }

        // Expecting a schema complexType
        nodeKind = Utils.getNodeQName(node);
        if (nodeKind != null &&
            nodeKind.getLocalPart().equals("complexType") &&
            Constants.isSchemaXSD(nodeKind.getNamespaceURI())) {

            // Under the complexType there could be should be a complexContent &
            // extension elements if this is a derived type.
            NodeList children = node.getChildNodes();
            Node content = null;
            Node extension = null;
            for (int j = 0; j < children.getLength() && content == null; j++) {
                QName contentKind = Utils.getNodeQName(children.item(j));
                if (contentKind != null &&
                    contentKind.getLocalPart().equals("complexContent") &&
                    Constants.isSchemaXSD(contentKind.getNamespaceURI()))
                    content = children.item(j);
                if (contentKind != null &&
                    contentKind.getLocalPart().equals("simpleContent") &&
                    Constants.isSchemaXSD(contentKind.getNamespaceURI()))
                    content = children.item(j);
            }
            if (content != null) {
                children = content.getChildNodes();
                for (int j = 0; j < children.getLength() && extension == null; j++) {
                    QName extensionKind = Utils.getNodeQName(children.item(j));
                    if (extensionKind != null &&
                        extensionKind.getLocalPart().equals("extension") &&
                        Constants.isSchemaXSD(extensionKind.getNamespaceURI()))
                        extension = children.item(j);
                }
            }
            if (extension == null) {
                return null// No extension                              
            }

            // Get the QName of the extension base
            QName extendsType = Utils.getNodeTypeRefQName(extension, "base");
            if (extendsType == null) {
                return null; // No extension base
            }
            // Return associated Type
            return (TypeEntry) symbolTable.getType(extendsType);
View Full Code Here

        if (node == null) {
            return null;
        }

        // If the node kind is an element, dive into it.
        QName nodeKind = Utils.getNodeQName(node);
        if (nodeKind != null &&
            nodeKind.getLocalPart().equals("element") &&
            Constants.isSchemaXSD(nodeKind.getNamespaceURI())) {
            NodeList children = node.getChildNodes();
            Node simpleNode = null;
            for (int j = 0; j < children.getLength() && simpleNode == null; j++) {
                QName simpleKind = Utils.getNodeQName(children.item(j));
                if (simpleKind != null &&
                    simpleKind.getLocalPart().equals("simpleType") &&
                    Constants.isSchemaXSD(simpleKind.getNamespaceURI())) {
                    simpleNode = children.item(j);
                    node = simpleNode;
                }
            }
        }
        // Get the node kind, expecting a schema simpleType
        nodeKind = Utils.getNodeQName(node);
        if (nodeKind != null &&
            nodeKind.getLocalPart().equals("simpleType") &&
            Constants.isSchemaXSD(nodeKind.getNamespaceURI())) {

            // Under the simpleType there should be a restriction.
            // (There may be other #text nodes, which we will ignore).
            NodeList children = node.getChildNodes();
            Node restrictionNode = null;
            for (int j = 0; j < children.getLength() && restrictionNode == null; j++) {
                QName restrictionKind = Utils.getNodeQName(children.item(j));
                if (restrictionKind != null &&
                    restrictionKind.getLocalPart().equals("restriction") &&
                    Constants.isSchemaXSD(restrictionKind.getNamespaceURI()))
                    restrictionNode = children.item(j);
            }

            // The restriction node indicates the type being restricted
            // (the base attribute contains this type).
            // The base type must be a built-in type, and not boolean
            TypeEntry baseEType = null;
            if (restrictionNode != null) {
                QName baseType = Utils.getNodeTypeRefQName(restrictionNode, "base");
                baseEType = symbolTable.getType(baseType);
                if (baseEType != null) {
                    String javaName = baseEType.getName();
                    if (javaName.equals("java.lang.String") ||
                        javaName.equals("int") ||
                        javaName.equals("long") ||
                        javaName.equals("short") ||
                        javaName.equals("float") ||
                        javaName.equals("double") ||
                        javaName.equals("byte"))
                        ; // Okay Type
                    else
                        baseEType = null;
                }
            }

            // Process the enumeration elements underneath the restriction node
            if (baseEType != null && restrictionNode != null) {

                Vector v = new Vector();               
                NodeList enums = restrictionNode.getChildNodes();
                for (int i=0; i < enums.getLength(); i++) {
                    QName enumKind = Utils.getNodeQName(enums.item(i));
                    if (enumKind != null &&
                        enumKind.getLocalPart().equals("enumeration") &&
                        Constants.isSchemaXSD(enumKind.getNamespaceURI())) {

                        // Put the enum value in the vector.
                        Node enumNode = enums.item(i);
                        String value = Utils.getAttribute(enumNode, "value");
                        if (value != null) {
View Full Code Here

    /**
     * Constructor.
     */
    protected JavaUndeployWriter(Emitter emitter, Definition definition, SymbolTable symbolTable) {
        super(emitter,
                new QName(definition.getTargetNamespace(), "undeploy"),
                "",
                "wsdd",
                JavaUtils.getMessage("genUndeploy00"));
        this.definition = definition;
        this.symbolTable = symbolTable;
View Full Code Here

    /**
     * Constructor.
     */
    protected JavaDeployWriter(Emitter emitter, Definition definition, SymbolTable symbolTable) {
        super(emitter,
                new QName(definition.getTargetNamespace(), "deploy"),
                "",
                "wsdd",
                JavaUtils.getMessage("genDeploy00"));
        this.definition = definition;
        this.symbolTable = symbolTable;
View Full Code Here

    /**
     * Write out deployment instructions for given WSDL binding
     */
    private void writeDeployBinding(Binding binding) throws IOException {
        QName bindingQName = binding.getQName();
        String packageName = namespaces.getCreate(bindingQName.getNamespaceURI());
        pw.println("      <parameter name=\"className\" value=\""
                         + packageName + "."
                         + bindingQName.getLocalPart() + "Skeleton" + "\"/>");

        String methodList = "";
        Iterator operationsIterator = binding.getBindingOperations().iterator();
        for (; operationsIterator.hasNext();) {
            BindingOperation op = (BindingOperation) operationsIterator.next();
View Full Code Here

        // iterate over fault list, emitting code.
        Iterator fi = faults.iterator();
        while (fi.hasNext()) {
            Fault fault = (Fault) fi.next();
            String exceptionName = Utils.getExceptionName(fault);
            QName faultQName = new QName(definition.getTargetNamespace(), exceptionName);
            new JavaFaultWriter(emitter, faultQName, fault, symbolTable).write();
        }
    } // writeFaults
View Full Code Here

TOP

Related Classes of javax.wsdl.QName

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.