当前位置: 首页>>代码示例>>Java>>正文


Java SchemaKinds类代码示例

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


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

示例1: getJAXBType

import com.sun.tools.internal.ws.wsdl.document.schema.SchemaKinds; //导入依赖的package包/类
/**
 * @param part
 * @return Returns a JAXBType object
 */
private JAXBType getJAXBType(MessagePart part) {
    JAXBType type;
    QName name = part.getDescriptor();
    if (part.getDescriptorKind().equals(SchemaKinds.XSD_ELEMENT)) {
        type = getJAXBModelBuilder().getJAXBType(name);
        if(type == null){
            error(part, ModelerMessages.WSDLMODELER_JAXB_JAVATYPE_NOTFOUND(name, part.getName()));
        }
    } else {
        S2JJAXBModel jaxbModel = getJAXBModelBuilder().getJAXBModel().getS2JJAXBModel();
        TypeAndAnnotation typeAnno = jaxbModel.getJavaType(name);
        if (typeAnno == null) {
            error(part, ModelerMessages.WSDLMODELER_JAXB_JAVATYPE_NOTFOUND(name, part.getName()));
        }
        JavaType javaType = new JavaSimpleType(new JAXBTypeAndAnnotation(typeAnno));
        type = new JAXBType(new QName("", part.getName()), javaType);
    }
    return type;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:24,代码来源:WSDLModeler.java

示例2: isStyleAndPartMatch

import com.sun.tools.internal.ws.wsdl.document.schema.SchemaKinds; //导入依赖的package包/类
/**
 * For Document/Lit the wsdl:part should only have element attribute and
 * for RPC/Lit or RPC/Encoded the wsdl:part should only have type attribute
 * inside wsdl:message.
 */
protected boolean isStyleAndPartMatch(
    SOAPOperation soapOperation,
    MessagePart part) {

    // style attribute on soap:operation takes precedence over the
    // style attribute on soap:binding

    if ((soapOperation != null) && (soapOperation.getStyle() != null)) {
        if ((soapOperation.isDocument()
            && (part.getDescriptorKind() != SchemaKinds.XSD_ELEMENT))
            || (soapOperation.isRPC()
                && (part.getDescriptorKind() != SchemaKinds.XSD_TYPE))) {
            return false;
        }
    } else {
        if ((info.soapBinding.isDocument()
            && (part.getDescriptorKind() != SchemaKinds.XSD_ELEMENT))
            || (info.soapBinding.isRPC()
                && (part.getDescriptorKind() != SchemaKinds.XSD_TYPE))) {
            return false;
        }
    }

    return true;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:31,代码来源:WSDLModelerBase.java

示例3: isValid

import com.sun.tools.internal.ws.wsdl.document.schema.SchemaKinds; //导入依赖的package包/类
public boolean isValid(Kind kind, QName name) {

        // just let all "xml:" QNames through
        if (name.getNamespaceURI().equals(Constants.NS_XML))
            return true;

        if (kind == SchemaKinds.XSD_TYPE) {
            return _validTypes.contains(name);
        } else if (kind == SchemaKinds.XSD_ELEMENT) {
            return _validElements.contains(name);
        } else if (kind == SchemaKinds.XSD_ATTRIBUTE) {
            return _validAttributes.contains(name);
        } else {
            // no luck
            return false;
        }
    }
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:SOAPEntityReferenceValidator.java

示例4: getJAXBType

import com.sun.tools.internal.ws.wsdl.document.schema.SchemaKinds; //导入依赖的package包/类
/**
 * @param part
 * @return Returns a JAXBType object
 */
private JAXBType getJAXBType(MessagePart part) {
    JAXBType type;
    QName name = part.getDescriptor();
    if (part.getDescriptorKind().equals(SchemaKinds.XSD_ELEMENT)) {
        type = jaxbModelBuilder.getJAXBType(name);
        if(type == null){
            error(part, ModelerMessages.WSDLMODELER_JAXB_JAVATYPE_NOTFOUND(name, part.getName()));
        }
    } else {
        S2JJAXBModel jaxbModel = getJAXBModelBuilder().getJAXBModel().getS2JJAXBModel();
        TypeAndAnnotation typeAnno = jaxbModel.getJavaType(name);
        if (typeAnno == null) {
            error(part, ModelerMessages.WSDLMODELER_JAXB_JAVATYPE_NOTFOUND(name, part.getName()));
        }
        JavaType javaType = new JavaSimpleType(new JAXBTypeAndAnnotation(typeAnno));
        type = new JAXBType(new QName("", part.getName()), javaType);
    }
    return type;
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:24,代码来源:WSDLModeler.java

示例5: getHeaderParts

import com.sun.tools.internal.ws.wsdl.document.schema.SchemaKinds; //导入依赖的package包/类
private List<MessagePart> getHeaderParts(BindingOperation bindingOperation, boolean isInput) {
    TWSDLExtensible ext;
    if (isInput) {
        ext = bindingOperation.getInput();
    } else {
        ext = bindingOperation.getOutput();
    }

    List<MessagePart> parts = new ArrayList<MessagePart>();
    Iterator<SOAPHeader> headers = getHeaderExtensions(ext).iterator();
    while (headers.hasNext()) {
        SOAPHeader header = headers.next();
        if (!header.isLiteral()) {
            error(header, ModelerMessages.WSDLMODELER_INVALID_HEADER_NOT_LITERAL(header.getPart(), bindingOperation.getName()));
        }

        if (header.getNamespace() != null) {
            warning(header, ModelerMessages.WSDLMODELER_WARNING_R_2716_R_2726("soapbind:header", bindingOperation.getName()));
        }
        com.sun.tools.internal.ws.wsdl.document.Message headerMessage = findMessage(header.getMessage(),document);
        if (headerMessage == null) {
            error(header, ModelerMessages.WSDLMODELER_INVALID_HEADER_CANT_RESOLVE_MESSAGE(header.getMessage(), bindingOperation.getName()));
        }

        MessagePart part = headerMessage.getPart(header.getPart());
        if (part == null) {
            error(header, ModelerMessages.WSDLMODELER_INVALID_HEADER_NOT_FOUND(header.getPart(), bindingOperation.getName()));
        }
        if (part.getDescriptorKind() != SchemaKinds.XSD_ELEMENT) {
            if (options.isExtensionMode()) {
                warning(part, ModelerMessages.WSDLMODELER_INVALID_HEADER_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(part.getName(), bindingOperation.getName()));
            } else {
                error(part, ModelerMessages.WSDLMODELER_INVALID_HEADER_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(part.getName(), bindingOperation.getName()));
            }
        }
        part.setBindingExtensibilityElementKind(MessagePart.SOAP_HEADER_BINDING);
        parts.add(part);
    }
    return parts;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:41,代码来源:WSDLModeler.java

示例6: parseMessagePart

import com.sun.tools.internal.ws.wsdl.document.schema.SchemaKinds; //导入依赖的package包/类
private MessagePart parseMessagePart(TWSDLParserContextImpl context, Element e) {
    context.push();
    context.registerNamespaces(e);
    MessagePart part = new MessagePart(forest.locatorTable.getStartLocation(e));
    String partName = Util.getRequiredAttribute(e, Constants.ATTR_NAME);
    part.setName(partName);

    String elementAttr =
        XmlUtil.getAttributeOrNull(e, Constants.ATTR_ELEMENT);
    String typeAttr = XmlUtil.getAttributeOrNull(e, Constants.ATTR_TYPE);

    if (elementAttr != null) {
        if (typeAttr != null) {
            errReceiver.error(context.getLocation(e), WsdlMessages.PARSING_ONLY_ONE_OF_ELEMENT_OR_TYPE_REQUIRED(partName));

        }

        part.setDescriptor(context.translateQualifiedName(context.getLocation(e), elementAttr));
        part.setDescriptorKind(SchemaKinds.XSD_ELEMENT);
    } else if (typeAttr != null) {
        part.setDescriptor(context.translateQualifiedName(context.getLocation(e), typeAttr));
        part.setDescriptorKind(SchemaKinds.XSD_TYPE);
    } else {
        // XXX-NOTE - this is wrong; for extensibility purposes,
        // any attribute can be specified on a <part> element, so
        // we need to put an extensibility hook here
        errReceiver.warning(forest.locatorTable.getStartLocation(e), WsdlMessages.PARSING_ELEMENT_OR_TYPE_REQUIRED(partName));
    }

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

示例7: getHeaderParts

import com.sun.tools.internal.ws.wsdl.document.schema.SchemaKinds; //导入依赖的package包/类
private List<MessagePart> getHeaderParts(BindingOperation bindingOperation, boolean isInput) {
    TWSDLExtensible ext;
    if (isInput) {
        ext = bindingOperation.getInput();
    } else {
        ext = bindingOperation.getOutput();
    }

    List<MessagePart> parts = new ArrayList<MessagePart>();
    Iterator<SOAPHeader> headers = getHeaderExtensions(ext).iterator();
    while (headers.hasNext()) {
        SOAPHeader header = headers.next();
        if (!header.isLiteral()) {
            error(header, ModelerMessages.WSDLMODELER_INVALID_HEADER_NOT_LITERAL(header.getPart(), bindingOperation.getName()));
        }

        if (header.getNamespace() != null) {
            warning(header, ModelerMessages.WSDLMODELER_WARNING_R_2716_R_2726("soapbind:header", bindingOperation.getName()));
        }
        com.sun.tools.internal.ws.wsdl.document.Message headerMessage = findMessage(header.getMessage(),document);
        if (headerMessage == null) {
            error(header, ModelerMessages.WSDLMODELER_INVALID_HEADER_CANT_RESOLVE_MESSAGE(header.getMessage(), bindingOperation.getName()));
        }

        MessagePart part = headerMessage.getPart(header.getPart());
        if (part == null) {
            error(header, ModelerMessages.WSDLMODELER_INVALID_HEADER_NOT_FOUND(header.getPart(), bindingOperation.getName()));
        }
        if (part.getDescriptorKind() != SchemaKinds.XSD_ELEMENT) {
            error(part, ModelerMessages.WSDLMODELER_INVALID_HEADER_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(part.getName(), bindingOperation.getName()));
        }
        part.setBindingExtensibilityElementKind(MessagePart.SOAP_HEADER_BINDING);
        parts.add(part);
    }
    return parts;
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:37,代码来源:WSDLModeler.java

示例8: build

import com.sun.tools.internal.ws.wsdl.document.schema.SchemaKinds; //导入依赖的package包/类
private void build(QName elementName, List<MessagePart> allParts){

        print(
                "<xs:schema xmlns:xs=''http://www.w3.org/2001/XMLSchema''" +
                "           xmlns:jaxb=''http://java.sun.com/xml/ns/jaxb''" +
                "           xmlns:xjc=''http://java.sun.com/xml/ns/jaxb/xjc''" +
                "           jaxb:extensionBindingPrefixes=''xjc''" +
                "           jaxb:version=''1.0''" +
                "           targetNamespace=''{0}''>",
                elementName.getNamespaceURI());

        writeImports(elementName, allParts);

        if(!asyncRespBeanBinding){
            print(
                    "<xs:annotation><xs:appinfo>" +
                    "  <jaxb:schemaBindings>" +
                    "    <jaxb:package name=''{0}'' />" +
                    "  </jaxb:schemaBindings>" +
                    "</xs:appinfo></xs:annotation>",
                    wsdlModeler.getJavaPackage() );
            asyncRespBeanBinding = true;
        }

        print("<xs:element name=''{0}''>", elementName.getLocalPart());
        print("<xs:complexType>");
        print("<xs:sequence>");


        for(MessagePart p:allParts) {
            //rpclit wsdl:part must reference schema type not element, also it must exclude headers and mime parts
            if(p.getDescriptorKind() == SchemaKinds.XSD_ELEMENT){
                print("<xs:element ref=''types:{0}'' xmlns:types=''{1}''/>",p.getDescriptor().getLocalPart(), p.getDescriptor().getNamespaceURI());
            }else{
                print("<xs:element name=''{0}'' type=''{1}'' xmlns=''{2}'' />",
                    p.getName(),
                    p.getDescriptor().getLocalPart(),
                    p.getDescriptor().getNamespaceURI() );
            }
        }

        print("</xs:sequence>");
        print("</xs:complexType>");
        print("</xs:element>");
        print("</xs:schema>");

        // reset the StringWriter, so that next operation element could be written
        if(buf.toString().length() > 0){
            //System.out.println("Response bean Schema for operation========> "+ elementName+"\n\n"+buf);
            InputSource is = new InputSource(new StringReader(buf.toString()));
            schemas.add(is);
            buf.getBuffer().setLength(0);
        }
    }
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:55,代码来源:PseudoSchemaBuilder.java

示例9: isUnwrappable

import com.sun.tools.internal.ws.wsdl.document.schema.SchemaKinds; //导入依赖的package包/类
protected boolean isUnwrappable() {
    if (!getWrapperStyleCustomization()) {
        return false;
    }

    com.sun.tools.internal.ws.wsdl.document.Message inputMessage = getInputMessage();
    com.sun.tools.internal.ws.wsdl.document.Message outputMessage = getOutputMessage();

    // Wrapper style if the operation's input and output messages each contain
    // only a single part
    if ((inputMessage != null && inputMessage.numParts() != 1)
            || (outputMessage != null && outputMessage.numParts() != 1)) {
        return false;
    }

    MessagePart inputPart = inputMessage != null
            ? inputMessage.parts().next() : null;
    MessagePart outputPart = outputMessage != null
            ? outputMessage.parts().next() : null;
    String operationName = info.portTypeOperation.getName();

    // Wrapper style if the input message part refers to a global element declaration whose localname
    // is equal to the operation name
    // Wrapper style if the output message part refers to a global element declaration
    if ((inputPart != null && !inputPart.getDescriptor().getLocalPart().equals(operationName)) ||
            (outputPart != null && outputPart.getDescriptorKind() != SchemaKinds.XSD_ELEMENT)) {
        return false;
    }

    //check to see if either input or output message part not bound to soapbing:body
    //in that case the operation is not wrapper style
    if (((inputPart != null) && (inputPart.getBindingExtensibilityElementKind() != MessagePart.SOAP_BODY_BINDING)) ||
            ((outputPart != null) && (outputPart.getBindingExtensibilityElementKind() != MessagePart.SOAP_BODY_BINDING))) {
        return false;
    }

    // Wrapper style if the elements referred to by the input and output message parts
    // (henceforth referred to as wrapper elements) are both complex types defined
    // using the xsd:sequence compositor
    // Wrapper style if the wrapper elements only contain child elements, they must not
    // contain other structures such as xsd:choice, substitution groups1 or attributes
    //These checkins are done by jaxb, we just check if jaxb has wrapper children. If there
    // are then its wrapper style
    //if(inputPart != null && outputPart != null){
    if (inputPart != null) {
        boolean inputWrappable = false;
        JAXBType inputType = getJAXBType(inputPart);
        if (inputType != null) {
            inputWrappable = inputType.isUnwrappable();
        }
        //if there are no output part (oneway), the operation can still be wrapper style
        if (outputPart == null) {
            return inputWrappable;
        }
        JAXBType outputType = getJAXBType(outputPart);
        if ((inputType != null) && (outputType != null)) {
            return inputType.isUnwrappable() && outputType.isUnwrappable();
        }
    }

    return false;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:63,代码来源:WSDLModeler.java


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