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


Java SchemaKinds.XSD_ELEMENT属性代码示例

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


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

示例1: isStyleAndPartMatch

/**
 * 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,代码行数:30,代码来源:WSDLModelerBase.java

示例2: isValid

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,代码行数:17,代码来源:SOAPEntityReferenceValidator.java

示例3: getHeaderParts

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,代码行数:40,代码来源:WSDLModeler.java

示例4: getHeaderParts

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,代码行数:36,代码来源:WSDLModeler.java

示例5: build

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,代码行数:54,代码来源:PseudoSchemaBuilder.java

示例6: isUnwrappable

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,代码行数:62,代码来源:WSDLModeler.java

示例7: getAttachmentType

private JAXBType getAttachmentType(List<MIMEContent> mimeContents, MessagePart part) {
    if (!enableMimeContent()) {
        return getJAXBType(part);
    }
    String javaType;
    List<String> mimeTypes = getAlternateMimeTypes(mimeContents);
    if (mimeTypes.size() > 1) {
        javaType = "javax.activation.DataHandler";
    } else {
        javaType = getJavaTypeForMimeType(mimeTypes.get(0));
    }

    S2JJAXBModel jaxbModel = getJAXBModelBuilder().getJAXBModel().getS2JJAXBModel();
    JType jt = options.getCodeModel().ref(javaType);
    QName desc = part.getDescriptor();
    TypeAndAnnotation typeAnno = null;

    if (part.getDescriptorKind() == SchemaKinds.XSD_TYPE) {
        typeAnno = jaxbModel.getJavaType(desc);
        desc = new QName("", part.getName());
    } else if (part.getDescriptorKind() == SchemaKinds.XSD_ELEMENT) {
        typeAnno = getJAXBModelBuilder().getElementTypeAndAnn(desc);
        if(typeAnno == null){
            error(part, ModelerMessages.WSDLMODELER_JAXB_JAVATYPE_NOTFOUND(part.getDescriptor(), part.getName()));
        }
        for (String mimeType : mimeTypes) {
            if ((!mimeType.equals("text/xml") && !mimeType.equals("application/xml"))) {
                //According to AP 1.0,
                //RZZZZ: In a DESCRIPTION, if a wsdl:part element refers to a
                //global element declaration (via the element attribute of the wsdl:part
                //element) then the value of the type attribute of a mime:content element
                //that binds that part MUST be a content type suitable for carrying an
                //XML serialization.
                //should we throw warning?
                //type = MimeHelper.javaType.DATA_HANDLER_JAVATYPE;
                warning(part, ModelerMessages.MIMEMODELER_ELEMENT_PART_INVALID_ELEMENT_MIME_TYPE(part.getName(), mimeType));
            }
        }
    }
    if (typeAnno == null) {
        error(part, ModelerMessages.WSDLMODELER_JAXB_JAVATYPE_NOTFOUND(desc, part.getName()));
    }
    return new JAXBType(desc, new JavaSimpleType(new JAXBTypeAndAnnotation(typeAnno, jt)),
            null, getJAXBModelBuilder().getJAXBModel());
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:45,代码来源:WSDLModeler.java

示例8: isUnwrappable

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:alexkasko,项目名称:openjdk-icedtea7,代码行数:58,代码来源:WSDLModeler.java

示例9: getAttachmentType

private JAXBType getAttachmentType(List<MIMEContent> mimeContents, MessagePart part) {
    if (!enableMimeContent()) {
        return getJAXBType(part);
    }
    String javaType;
    List<String> mimeTypes = getAlternateMimeTypes(mimeContents);
    if (mimeTypes.size() > 1) {
        javaType = "javax.activation.DataHandler";
    } else {
        javaType = getJavaTypeForMimeType(mimeTypes.get(0));
    }

    S2JJAXBModel jaxbModel = getJAXBModelBuilder().getJAXBModel().getS2JJAXBModel();
    JType jt = options.getCodeModel().ref(javaType);
    QName desc = part.getDescriptor();
    TypeAndAnnotation typeAnno = null;

    if (part.getDescriptorKind() == SchemaKinds.XSD_TYPE) {
        typeAnno = jaxbModel.getJavaType(desc);
        desc = new QName("", part.getName());
    } else if (part.getDescriptorKind() == SchemaKinds.XSD_ELEMENT) {
        typeAnno = getJAXBModelBuilder().getElementTypeAndAnn(desc);
        if(typeAnno == null){
            error(part, ModelerMessages.WSDLMODELER_JAXB_JAVATYPE_NOTFOUND(part.getDescriptor(), part.getName()));
        }
        for (Iterator mimeTypeIter = mimeTypes.iterator(); mimeTypeIter.hasNext();) {
            String mimeType = (String) mimeTypeIter.next();
            if ((!mimeType.equals("text/xml") &&
                    !mimeType.equals("application/xml"))) {
                //According to AP 1.0,
                //RZZZZ: In a DESCRIPTION, if a wsdl:part element refers to a
                //global element declaration (via the element attribute of the wsdl:part
                //element) then the value of the type attribute of a mime:content element
                //that binds that part MUST be a content type suitable for carrying an
                //XML serialization.
                //should we throw warning?
                //type = MimeHelper.javaType.DATA_HANDLER_JAVATYPE;
                warning(part, ModelerMessages.MIMEMODELER_ELEMENT_PART_INVALID_ELEMENT_MIME_TYPE(part.getName(), mimeType));
            }
        }
    }
    if (typeAnno == null) {
        error(part, ModelerMessages.WSDLMODELER_JAXB_JAVATYPE_NOTFOUND(desc, part.getName()));
    }
    return new JAXBType(desc, new JavaSimpleType(new JAXBTypeAndAnnotation(typeAnno, jt)),
            null, getJAXBModelBuilder().getJAXBModel());
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:47,代码来源:WSDLModeler.java


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