• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Definitions类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.sun.tools.internal.ws.wsdl.document.Definitions的典型用法代码示例。如果您正苦于以下问题:Java Definitions类的具体用法?Java Definitions怎么用?Java Definitions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Definitions类属于com.sun.tools.internal.ws.wsdl.document包,在下文中一共展示了Definitions类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: buildWSDLDocument

import com.sun.tools.internal.ws.wsdl.document.Definitions; //导入依赖的package包/类
private WSDLDocument buildWSDLDocument(){
    /**
     * Currently we are working off first WSDL document
     * TODO: add support of creating WSDLDocument from fromjava.collection of WSDL documents
     */

    String location = forest.getRootWSDL();

    //It means that WSDL is not found, an error might have been reported, lets try to recover
    if(location == null)
        return null;

    Document root = forest.get(location);

    if(root == null)
        return null;

    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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:26,代码来源:WSDLParser.java


示例2: parseDefinitions

import com.sun.tools.internal.ws.wsdl.document.Definitions; //导入依赖的package包/类
private Definitions parseDefinitions(TWSDLParserContextImpl context, Document root) {
    context.pushWSDLLocation();
    context.setWSDLLocation(context.getDocument().getSystemId());

    new Internalizer(forest, options, errReceiver).transform();

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

    }
    processImports(context);
    context.popWSDLLocation();
    return definitions;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:WSDLParser.java


示例3: parseDefinitions

import com.sun.tools.internal.ws.wsdl.document.Definitions; //导入依赖的package包/类
private Definitions parseDefinitions(TWSDLParserContextImpl context, Document root) {
        context.pushWSDLLocation();
        context.setWSDLLocation(context.getDocument().getSystemId());

        new Internalizer(forest, options, errReceiver).transform();

        //print the wsdl
//        try{
//            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()));

        }
        processImports(context);
        context.popWSDLLocation();
        return definitions;
    }
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:24,代码来源:WSDLParser.java


示例4: processImports

import com.sun.tools.internal.ws.wsdl.document.Definitions; //导入依赖的package包/类
private void processImports(TWSDLParserContextImpl context) {
    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);
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:WSDLParser.java


示例5: parseImport

import com.sun.tools.internal.ws.wsdl.document.Definitions; //导入依赖的package包/类
private Import parseImport(
    TWSDLParserContextImpl context,
    Definitions definitions,
    Element e) {
    context.push();
    context.registerNamespaces(e);
    Import anImport = new Import(forest.locatorTable.getStartLocation(e));
    String namespace =
        Util.getRequiredAttribute(e, Constants.ATTR_NAMESPACE);
    anImport.setNamespace(namespace);
    String location = Util.getRequiredAttribute(e, Constants.ATTR_LOCATION);
    anImport.setLocation(location);

    // according to the schema in the WSDL 1.1 spec, an import can have a documentation element
    boolean gotDocumentation = 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(e), WsdlMessages.PARSING_ONLY_ONE_DOCUMENTATION_ALLOWED(e.getLocalName()));
            }
            gotDocumentation = true;
            anImport.setDocumentation(getDocumentationFor(e2));
        } else {
            errReceiver.error(forest.locatorTable.getStartLocation(e2), WsdlMessages.PARSING_INVALID_ELEMENT(e2.getTagName(),
                e2.getNamespaceURI()));
        }
    }
    context.pop();
    context.fireDoneParsingEntity(WSDLConstants.QNAME_IMPORT, anImport);
    return anImport;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:37,代码来源:WSDLParser.java


示例6: processMexDocs

import com.sun.tools.internal.ws.wsdl.document.Definitions; //导入依赖的package包/类
private void processMexDocs(TWSDLParserContextImpl context){
    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);
        }
    }
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:15,代码来源:WSDLParser.java


示例7: parseService

import com.sun.tools.internal.ws.wsdl.document.Definitions; //导入依赖的package包/类
private Service parseService(
    TWSDLParserContextImpl context,
    Definitions definitions,
    Element e) {
    context.push();
    context.registerNamespaces(e);
    Service service = new Service(definitions, forest.locatorTable.getStartLocation(e), errReceiver);
    String name = Util.getRequiredAttribute(e, Constants.ATTR_NAME);
    service.setName(name);

    boolean gotDocumentation = 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(e), WsdlMessages.PARSING_ONLY_ONE_DOCUMENTATION_ALLOWED(e.getLocalName()));
            }
            gotDocumentation = true;
            if(service.getDocumentation() == null)
                service.setDocumentation(getDocumentationFor(e2));
        } else if (XmlUtil.matchesTagNS(e2, WSDLConstants.QNAME_PORT)) {
            Port port = parsePort(context, definitions, e2);
            service.add(port);
        } else {
            // possible extensibility element -- must live outside the WSDL namespace
            checkNotWsdlElement(e2);
            if (!handleExtension(context, service, e2)) {
                checkNotWsdlRequired(e2);
            }
        }
    }

    context.pop();
    context.fireDoneParsingEntity(WSDLConstants.QNAME_SERVICE, service);
    return service;
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:41,代码来源:WSDLParser.java


示例8: parseDefinitionsNoImport

import com.sun.tools.internal.ws.wsdl.document.Definitions; //导入依赖的package包/类
private Definitions parseDefinitionsNoImport(
    TWSDLParserContextImpl context,
    Document doc) {
    Element e = doc.getDocumentElement();
    //at this poinjt we expect a wsdl or schema document to be fully qualified
    if(e.getNamespaceURI() == null || (!e.getNamespaceURI().equals(WSDLConstants.NS_WSDL) || !e.getLocalName().equals("definitions"))){
        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);
            if (!handleExtension(context, definitions, e2)) {
                checkNotWsdlRequired(e2);
            }
        }
    }

    context.pop();
    context.fireDoneParsingEntity(
        WSDLConstants.QNAME_DEFINITIONS,
        definitions);
    return definitions;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:79,代码来源:WSDLParser.java


示例9: parseMessage

import com.sun.tools.internal.ws.wsdl.document.Definitions; //导入依赖的package包/类
private Message parseMessage(
    TWSDLParserContextImpl context,
    Definitions definitions,
    Element e) {
    context.push();
    context.registerNamespaces(e);
    Message message = new Message(definitions, forest.locatorTable.getStartLocation(e), errReceiver);
    String name = Util.getRequiredAttribute(e, Constants.ATTR_NAME);
    message.setName(name);

    boolean gotDocumentation = 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) {
                Util.fail(
                    "parsing.onlyOneDocumentationAllowed",
                    e.getLocalName());
            }
            gotDocumentation = true;
            message.setDocumentation(getDocumentationFor(e2));
        } else if (XmlUtil.matchesTagNS(e2, WSDLConstants.QNAME_PART)) {
            MessagePart part = parseMessagePart(context, e2);
            message.add(part);
        } else {
            //Ignore any extensibility elements, WS-I BP 1.1 Profiled WSDL 1.1 schema allows extension elements here.
            /*Util.fail(
                "parsing.invalidElement",
                e2.getTagName(),
                e2.getNamespaceURI());
                */
        }
    }

    context.pop();
    context.fireDoneParsingEntity(WSDLConstants.QNAME_MESSAGE, message);
    return message;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:43,代码来源:WSDLParser.java


示例10: parsePortType

import com.sun.tools.internal.ws.wsdl.document.Definitions; //导入依赖的package包/类
private PortType parsePortType(
    TWSDLParserContextImpl context,
    Definitions definitions,
    Element e) {
    context.push();
    context.registerNamespaces(e);
    PortType portType = new PortType(definitions, forest.locatorTable.getStartLocation(e), errReceiver);
    String name = Util.getRequiredAttribute(e, Constants.ATTR_NAME);
    portType.setName(name);

    boolean gotDocumentation = 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(e), WsdlMessages.PARSING_ONLY_ONE_DOCUMENTATION_ALLOWED(e.getLocalName()));
            }
            gotDocumentation = true;
            if(portType.getDocumentation() == null)
                portType.setDocumentation(getDocumentationFor(e2));
        } else if (
            XmlUtil.matchesTagNS(e2, WSDLConstants.QNAME_OPERATION)) {
            Operation op = parsePortTypeOperation(context, e2);
            op.setParent(portType);
            portType.add(op);
        } else {
            // possible extensibility element -- must live outside the WSDL namespace
            checkNotWsdlElement(e2);
            if (!handleExtension(context, portType, e2)) {
                checkNotWsdlRequired(e2);
            }
        }/*else {
            Util.fail(
                "parsing.invalidElement",
                e2.getTagName(),
                e2.getNamespaceURI());
        }*/
    }

    context.pop();
    context.fireDoneParsingEntity(WSDLConstants.QNAME_PORT_TYPE, portType);
    return portType;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:48,代码来源:WSDLParser.java


示例11: parseBinding

import com.sun.tools.internal.ws.wsdl.document.Definitions; //导入依赖的package包/类
private Binding parseBinding(
    TWSDLParserContextImpl context,
    Definitions definitions,
    Element e) {
    context.push();
    context.registerNamespaces(e);
    Binding binding = new Binding(definitions, forest.locatorTable.getStartLocation(e), errReceiver);
    String name = Util.getRequiredAttribute(e, Constants.ATTR_NAME);
    binding.setName(name);
    String typeAttr = Util.getRequiredAttribute(e, Constants.ATTR_TYPE);
    binding.setPortType(context.translateQualifiedName(context.getLocation(e), typeAttr));

    boolean gotDocumentation = 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(e), WsdlMessages.PARSING_ONLY_ONE_DOCUMENTATION_ALLOWED(e.getLocalName()));
            }
            gotDocumentation = true;
            binding.setDocumentation(getDocumentationFor(e2));
        } else if (
            XmlUtil.matchesTagNS(e2, WSDLConstants.QNAME_OPERATION)) {
            BindingOperation op = parseBindingOperation(context, e2);
            binding.add(op);
        } else {
            // possible extensibility element -- must live outside the WSDL namespace
            checkNotWsdlElement(e2);
            if (!handleExtension(context, binding, e2)) {
                checkNotWsdlRequired(e2);
            }
        }
    }

    context.pop();
    context.fireDoneParsingEntity(WSDLConstants.QNAME_BINDING, binding);
    return binding;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:43,代码来源:WSDLParser.java


示例12: parseService

import com.sun.tools.internal.ws.wsdl.document.Definitions; //导入依赖的package包/类
private Service parseService(
    TWSDLParserContextImpl context,
    Definitions definitions,
    Element e) {
    context.push();
    context.registerNamespaces(e);
    Service service = new Service(definitions, forest.locatorTable.getStartLocation(e), errReceiver);
    String name = Util.getRequiredAttribute(e, Constants.ATTR_NAME);
    service.setName(name);

    boolean gotDocumentation = 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(e), WsdlMessages.PARSING_ONLY_ONE_DOCUMENTATION_ALLOWED(e.getLocalName()));
            }
            gotDocumentation = true;
            if (service.getDocumentation() == null) {
                service.setDocumentation(getDocumentationFor(e2));
            }
        } else if (XmlUtil.matchesTagNS(e2, WSDLConstants.QNAME_PORT)) {
            Port port = parsePort(context, definitions, e2);
            service.add(port);
        } else {
            // possible extensibility element -- must live outside the WSDL namespace
            checkNotWsdlElement(e2);
            if (!handleExtension(context, service, e2)) {
                checkNotWsdlRequired(e2);
            }
        }
    }

    context.pop();
    context.fireDoneParsingEntity(WSDLConstants.QNAME_SERVICE, service);
    return service;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:42,代码来源:WSDLParser.java


示例13: parsePort

import com.sun.tools.internal.ws.wsdl.document.Definitions; //导入依赖的package包/类
private Port parsePort(
    TWSDLParserContextImpl context,
    Definitions definitions,
    Element e) {
    context.push();
    context.registerNamespaces(e);

    Port port = new Port(definitions, forest.locatorTable.getStartLocation(e), errReceiver);
    String name = Util.getRequiredAttribute(e, Constants.ATTR_NAME);
    port.setName(name);

    String bindingAttr =
        Util.getRequiredAttribute(e, Constants.ATTR_BINDING);
    port.setBinding(context.translateQualifiedName(context.getLocation(e), bindingAttr));

    boolean gotDocumentation = 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(e), WsdlMessages.PARSING_ONLY_ONE_DOCUMENTATION_ALLOWED(e.getLocalName()));
            }
            gotDocumentation = true;
            if (port.getDocumentation() == null) {
                port.setDocumentation(getDocumentationFor(e2));
            }
        } else {
            // possible extensibility element -- must live outside the WSDL namespace
            checkNotWsdlElement(e2);
            if (!handleExtension(context, port, e2)) {
                checkNotWsdlRequired(e2);
            }
        }
    }

    context.pop();
    context.fireDoneParsingEntity(WSDLConstants.QNAME_PORT, port);
    return port;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:45,代码来源:WSDLParser.java



注:本文中的com.sun.tools.internal.ws.wsdl.document.Definitions类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Block类代码示例发布时间:2022-05-23
下一篇:
Java JAXBType类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap