Package com.sun.tools.internal.ws.wsdl.document

Examples of com.sun.tools.internal.ws.wsdl.document.Definitions


        WSDLDocument document = new WSDLDocument(forest, errReceiver);
        document.setSystemId(location);
        TWSDLParserContextImpl context = new TWSDLParserContextImpl(forest, document, listeners, errReceiver);

        Definitions definitions = parseDefinitions(context, root);
        document.setDefinitions(definitions);
        return document;
    }
View Full Code Here


//            forest.dump(System.out);
//        }catch(IOException e){
//            e.printStackTrace();
//        }

        Definitions definitions = parseDefinitionsNoImport(context, root);
        if(definitions == null){
            Locator locator = forest.locatorTable.getStartLocation(root.getDocumentElement());
            errReceiver.error(locator, WsdlMessages.PARSING_NOT_AWSDL(locator.getSystemId()));

        }
View Full Code Here

        for(String location : forest.listSystemIDs()){
            if (!context.getDocument().isImportedDocument(location)){
                Document doc = forest.get(location);
                if(doc == null)
                    continue;
                Definitions importedDefinitions = parseDefinitionsNoImport(context, doc);
                if(importedDefinitions == null)
                    continue;
                context.getDocument().addImportedEntity(importedDefinitions);
                context.getDocument().addImportedDocument(location);
            }
View Full Code Here

        for(String location : forest.getExternalReferences()){
            if (!context.getDocument().isImportedDocument(location)){
                Document doc = forest.get(location);
                if(doc == null)
                    continue;
                Definitions importedDefinitions = parseDefinitionsNoImport(context, doc);
                if(importedDefinitions == null)
                    continue;
                context.getDocument().addImportedEntity(importedDefinitions);
                context.getDocument().addImportedDocument(location);
            }
View Full Code Here

            return null;
        }
        context.push();
        context.registerNamespaces(e);

        Definitions definitions = new Definitions(context.getDocument(), forest.locatorTable.getStartLocation(e));
        String name = XmlUtil.getAttributeOrNull(e, Constants.ATTR_NAME);
        definitions.setName(name);

        String targetNamespaceURI =
            XmlUtil.getAttributeOrNull(e, Constants.ATTR_TARGET_NAMESPACE);

        definitions.setTargetNamespaceURI(targetNamespaceURI);

        boolean gotDocumentation = false;
        boolean gotTypes = false;

        for (Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();) {
            Element e2 = Util.nextElement(iter);
            if (e2 == null)
                break;

            if (XmlUtil.matchesTagNS(e2, WSDLConstants.QNAME_DOCUMENTATION)) {
                if (gotDocumentation) {
                    errReceiver.error(forest.locatorTable.getStartLocation(e2), WsdlMessages.PARSING_ONLY_ONE_DOCUMENTATION_ALLOWED(e.getLocalName()));
                    return null;
                }
                gotDocumentation = true;
                if(definitions.getDocumentation() == null)
                    definitions.setDocumentation(getDocumentationFor(e2));
            } else if (XmlUtil.matchesTagNS(e2, WSDLConstants.QNAME_TYPES)) {
                if (gotTypes && !options.isExtensionMode()) {
                    errReceiver.error(forest.locatorTable.getStartLocation(e2), WsdlMessages.PARSING_ONLY_ONE_TYPES_ALLOWED(Constants.TAG_DEFINITIONS));
                    return null;
                }
                gotTypes = true;
                //add all the wsdl:type elements to latter make a list of all the schema elements
                // that will be needed to create jaxb model
                if(!options.isExtensionMode())
                    validateSchemaImports(e2);
            } else if (XmlUtil.matchesTagNS(e2, WSDLConstants.QNAME_MESSAGE)) {
                Message message = parseMessage(context, definitions, e2);
                definitions.add(message);
            } else if (
                XmlUtil.matchesTagNS(e2, WSDLConstants.QNAME_PORT_TYPE)) {
                PortType portType = parsePortType(context, definitions, e2);
                definitions.add(portType);
            } else if (XmlUtil.matchesTagNS(e2, WSDLConstants.QNAME_BINDING)) {
                Binding binding = parseBinding(context, definitions, e2);
                definitions.add(binding);
            } else if (XmlUtil.matchesTagNS(e2, WSDLConstants.QNAME_SERVICE)) {
                Service service = parseService(context, definitions, e2);
                definitions.add(service);
            } else if (XmlUtil.matchesTagNS(e2, WSDLConstants.QNAME_IMPORT)) {
                definitions.add(parseImport(context, definitions, e2));
            } else if (XmlUtil.matchesTagNS(e2, SchemaConstants.QNAME_IMPORT)) {
                errReceiver.warning(forest.locatorTable.getStartLocation(e2), WsdlMessages.WARNING_WSI_R_2003());
            } else {
                // possible extensibility element -- must live outside the WSDL namespace
                checkNotWsdlElement(e2);
View Full Code Here

        WSDLDocument document = new WSDLDocument(forest, errReceiver);
        document.setSystemId(location);
        TWSDLParserContextImpl context = new TWSDLParserContextImpl(forest, document, listeners, errReceiver);

        Definitions definitions = parseDefinitions(context, root);
        document.setDefinitions(definitions);
        return document;
    }
View Full Code Here

//            forest.dump(System.out);
//        }catch(IOException e){
//            e.printStackTrace();
//        }

        Definitions definitions = parseDefinitionsNoImport(context, root);
        if(definitions == null){
            Locator locator = forest.locatorTable.getStartLocation(root.getDocumentElement());
            errReceiver.error(locator, WsdlMessages.PARSING_NOT_AWSDL(locator.getSystemId()));

        }
View Full Code Here

        for(String location : forest.listSystemIDs()){
            if (!context.getDocument().isImportedDocument(location)){
                Document doc = forest.get(location);
                if(doc == null)
                    continue;
                Definitions importedDefinitions = parseDefinitionsNoImport(context, doc);
                if(importedDefinitions == null)
                    continue;
                context.getDocument().addImportedEntity(importedDefinitions);
                context.getDocument().addImportedDocument(location);
            }
View Full Code Here

        for(String location : forest.getExternalReferences()){
            if (!context.getDocument().isImportedDocument(location)){
                Document doc = forest.get(location);
                if(doc == null)
                    continue;
                Definitions importedDefinitions = parseDefinitionsNoImport(context, doc);
                if(importedDefinitions == null)
                    continue;
                context.getDocument().addImportedEntity(importedDefinitions);
                context.getDocument().addImportedDocument(location);
            }
View Full Code Here

            return null;
        }
        context.push();
        context.registerNamespaces(e);

        Definitions definitions = new Definitions(context.getDocument(), forest.locatorTable.getStartLocation(e));
        String name = XmlUtil.getAttributeOrNull(e, Constants.ATTR_NAME);
        definitions.setName(name);

        String targetNamespaceURI =
            XmlUtil.getAttributeOrNull(e, Constants.ATTR_TARGET_NAMESPACE);

        definitions.setTargetNamespaceURI(targetNamespaceURI);

        boolean gotDocumentation = false;
        boolean gotTypes = false;

        for (Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();) {
            Element e2 = Util.nextElement(iter);
            if (e2 == null)
                break;

            if (XmlUtil.matchesTagNS(e2, WSDLConstants.QNAME_DOCUMENTATION)) {
                if (gotDocumentation) {
                    errReceiver.error(forest.locatorTable.getStartLocation(e2), WsdlMessages.PARSING_ONLY_ONE_DOCUMENTATION_ALLOWED(e.getLocalName()));
                    return null;
                }
                gotDocumentation = true;
                if(definitions.getDocumentation() == null)
                    definitions.setDocumentation(getDocumentationFor(e2));
            } else if (XmlUtil.matchesTagNS(e2, WSDLConstants.QNAME_TYPES)) {
                if (gotTypes && !options.isExtensionMode()) {
                    errReceiver.error(forest.locatorTable.getStartLocation(e2), WsdlMessages.PARSING_ONLY_ONE_TYPES_ALLOWED(Constants.TAG_DEFINITIONS));
                    return null;
                }
                gotTypes = true;
                //add all the wsdl:type elements to latter make a list of all the schema elements
                // that will be needed to create jaxb model
                if(!options.isExtensionMode())
                    validateSchemaImports(e2);
            } else if (XmlUtil.matchesTagNS(e2, WSDLConstants.QNAME_MESSAGE)) {
                Message message = parseMessage(context, definitions, e2);
                definitions.add(message);
            } else if (
                XmlUtil.matchesTagNS(e2, WSDLConstants.QNAME_PORT_TYPE)) {
                PortType portType = parsePortType(context, definitions, e2);
                definitions.add(portType);
            } else if (XmlUtil.matchesTagNS(e2, WSDLConstants.QNAME_BINDING)) {
                Binding binding = parseBinding(context, definitions, e2);
                definitions.add(binding);
            } else if (XmlUtil.matchesTagNS(e2, WSDLConstants.QNAME_SERVICE)) {
                Service service = parseService(context, definitions, e2);
                definitions.add(service);
            } else if (XmlUtil.matchesTagNS(e2, WSDLConstants.QNAME_IMPORT)) {
                definitions.add(parseImport(context, definitions, e2));
            } else if (XmlUtil.matchesTagNS(e2, SchemaConstants.QNAME_IMPORT)) {
                errReceiver.warning(forest.locatorTable.getStartLocation(e2), WsdlMessages.WARNING_WSI_R_2003());
            } else {
                // possible extensibility element -- must live outside the WSDL namespace
                checkNotWsdlElement(e2);
View Full Code Here

TOP

Related Classes of com.sun.tools.internal.ws.wsdl.document.Definitions

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.