Package org.apache.ws.commons.schema

Examples of org.apache.ws.commons.schema.XmlSchemaComplexType


            schemaInfo.setElement(null);

            part.setXmlSchema(el);

            XmlSchemaComplexType ct = new XmlSchemaComplexType(schemaInfo.getSchema(), false);
            el.setSchemaType(ct);
            XmlSchemaSequence seq = new XmlSchemaSequence();
            ct.setParticle(seq);

            Method methods[] = cls.getMethods();
            for (Method m : methods) {
                if (m.getName().startsWith("get")
                    || m.getName().startsWith("is")) {
View Full Code Here


       
        if (respectXmlTypeNS) {
            schema = faultBeanSchema; //create complexType in the new created schema for xmlType
        }
       
        XmlSchemaComplexType ct = new XmlSchemaComplexType(schema, true);
        ct.setName(faultTypeName);

        el.setSchemaTypeName(ct.getQName());

        XmlSchemaSequence seq = new XmlSchemaSequence();
        ct.setParticle(seq);
        String namespace = part.getElementQName().getNamespaceURI();
        XmlAccessType accessType = Utils.getXmlAccessType(cls);
//
        for (Field f : Utils.getFields(cls, accessType)) {
            //map field
View Full Code Here

        OperationInfo unwrapped = new UnwrappedOperationInfo(opInfo);
        MessageInfo unwrappedInput = new MessageInfo(unwrapped, MessageInfo.Type.INPUT,
                                                     inputMessage.getName());
        MessageInfo unwrappedOutput = null;

        XmlSchemaComplexType xsct = null;
        if (inputEl.getSchemaType() instanceof XmlSchemaComplexType) {
           
            xsct = (XmlSchemaComplexType)inputEl.getSchemaType();
            if (hasAttributes(xsct)
                || (inputEl.isNillable() && !relaxed)
                || !isWrappableSequence(xsct, inputEl.getQName().getNamespaceURI(),
                                        unwrappedInput, allowRefs)) {
                passedRule = false;
            }
        } else {
            passedRule = false;
        }

        if (!passedRule) {
            return;
        }

        if (outputMessage != null) {
            unwrappedOutput = new MessageInfo(unwrapped, MessageInfo.Type.OUTPUT, outputMessage.getName());

            if (outputEl != null && outputEl.getSchemaType() instanceof XmlSchemaComplexType) {
                xsct = (XmlSchemaComplexType)outputEl.getSchemaType();
                if (xsct.isAbstract()) {
                    passedRule = false;
                }
                if (hasAttributes(xsct)
                    || (outputEl.isNillable() && !relaxed)
                    || !isWrappableSequence(xsct, outputEl.getQName().getNamespaceURI(), unwrappedOutput,
View Full Code Here

        }
        if (hasDefinedArray(root)) {
            return;
        }

        XmlSchemaComplexType complex = new XmlSchemaComplexType(root, true);
        complex.setName(getSchemaType().getLocalPart());

        XmlSchemaSequence seq = new XmlSchemaSequence();
        complex.setParticle(seq);

        AegisType componentType = getComponentType();
        XmlSchemaElement element = new XmlSchemaElement(root, false);
        element.setName(componentType.getSchemaType().getLocalPart());
        element.setSchemaTypeName(componentType.getSchemaType());
View Full Code Here

        String wrappertype = "";
        boolean nons = qname.getNamespaceURI().length() == 0;
        boolean dfltns = false;
        boolean complex = false;
        if (type instanceof XmlSchemaComplexType) {
            XmlSchemaComplexType ctype = (XmlSchemaComplexType)type;
            if (ctype.getAttributes().getCount() != 0) {
                throw new RuntimeException("Cannot unwrap element " +
                    qname + ": attributes not allowed on type to be unwrapped");
            }
            XmlSchemaParticle particle = ctype.getParticle();
            if (particle != null) {
               
                // if there's a particle present, it must be a sequence
                if (!(particle instanceof XmlSchemaSequence)) {
                    throw new RuntimeException("Cannot unwrap element " +
View Full Code Here

            schemaInfo.setElement(null);

            part.setXmlSchema(el);

            XmlSchemaComplexType ct = new XmlSchemaComplexType(schemaInfo.getSchema(), false);
            el.setSchemaType(ct);
            XmlSchemaSequence seq = new XmlSchemaSequence();
            ct.setParticle(seq);

            Method methods[] = cls.getMethods();
            for (Method m : methods) {
                if (m.getName().startsWith("get")
                    || m.getName().startsWith("is")) {
View Full Code Here

       
        if (respectXmlTypeNS) {
            schema = faultBeanSchema; //create complexType in the new created schema for xmlType
        }
       
        XmlSchemaComplexType ct = new XmlSchemaComplexType(schema, true);
        ct.setName(faultTypeName);

        el.setSchemaTypeName(ct.getQName());

        XmlSchemaSequence seq = new XmlSchemaSequence();
        ct.setParticle(seq);
        String namespace = part.getElementQName().getNamespaceURI();
        XmlAccessType accessType = Utils.getXmlAccessType(cls);
//
        for (Field f : Utils.getFields(cls, accessType)) {
            //map field
View Full Code Here

     * @param params
     * @return
     */
    public static Document buildDocument(XmlSchemaElement element, List<Param> params) {
        Document doc = DomUtil.createDocument();
        XmlSchemaComplexType cplxType = (XmlSchemaComplexType) element.getSchemaType();
        XmlSchemaSequence seq = (XmlSchemaSequence) cplxType.getParticle();
        Element e = doc.createElementNS(element.getQName().getNamespaceURI(), element.getQName().getLocalPart());
        e.setAttribute(XMLConstants.XMLNS_ATTRIBUTE, element.getQName().getNamespaceURI());
        doc.appendChild(e);
        for (int i = 0; i < seq.getItems().getCount(); i++) {
            XmlSchemaElement elChild = (XmlSchemaElement) seq.getItems().getItem(i);
View Full Code Here

        }           
        return doc;
    }
   
    public static Document interopolateParams(Document doc, XmlSchemaElement element, List<Param> params) {
        XmlSchemaComplexType cplxType = (XmlSchemaComplexType)element.getSchemaType();
        XmlSchemaSequence seq = (XmlSchemaSequence)cplxType.getParticle();
        Element root = doc.getDocumentElement();
        if (root == null) {
            root = doc.createElementNS(element.getQName().getNamespaceURI(),
                                    element.getQName().getLocalPart());
            root.setAttribute(XMLConstants.XMLNS_ATTRIBUTE, element.getQName().getNamespaceURI());
View Full Code Here

    public static List<XmlSchemaAnnotated>
    getContentAttributes(XmlSchemaComplexType type, SchemaCollection collection) {
        List<XmlSchemaAnnotated> results = new ArrayList<XmlSchemaAnnotated>();
        QName baseTypeName = getBaseType(type);
        if (baseTypeName != null) {
            XmlSchemaComplexType baseType = (XmlSchemaComplexType)collection.getTypeByQName(baseTypeName);
            // recurse onto the base type ...
            results.addAll(getContentAttributes(baseType, collection));
            // and now process our sequence.
            List<XmlSchemaAttributeOrGroupRef> extAttrs = getContentAttributes(type);
            results.addAll(extAttrs);
View Full Code Here

TOP

Related Classes of org.apache.ws.commons.schema.XmlSchemaComplexType

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.