Examples of XmlSchemaComplexType


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

        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) {
            org.apache.cxf.common.i18n.Message message
                = new org.apache.cxf.common.i18n.Message("WRAPPED_RULE_4", LOG, opInfo.getName());
            LOG.log(logLevel, message.toString());
            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

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

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

       
        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

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

        }
        return false;
    }
   
    private void buildGenericElements(XmlSchema schema, XmlSchemaSequence seq, Field f) {
        XmlSchemaComplexType generics = new XmlSchemaComplexType(schema, true);
        Type type = f.getGenericType();
        String rawType = ((ParameterizedType)type).getRawType().toString();
        String typeName = StringUtils.uncapitalize(rawType.substring(rawType.lastIndexOf(".") + 1));
        generics.setName(typeName);

        Class<?> genericsClass = f.getType();
        buildGenericSeq(schema, generics, genericsClass);  

        String name = Character.toLowerCase(f.getName().charAt(0)) + f.getName().substring(1);
        XmlSchemaElement newel = new XmlSchemaElement(schema, false);
        newel.setName(name);
        newel.setSchemaTypeName(generics.getQName());
        newel.setMinOccurs(0);
        if (!seq.getItems().contains(newel)) {
            seq.getItems().add(newel);
        }
    }
View Full Code Here

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

    
    private void buildGenericElements(XmlSchema schema, XmlSchemaSequence seq, Method m, Type type) {      
        String rawType = ((ParameterizedType)type).getRawType().toString();
        String typeName = StringUtils.uncapitalize(rawType.substring(rawType.lastIndexOf(".") + 1));
       
        XmlSchemaComplexType generics = (XmlSchemaComplexType)schema.getTypeByName(typeName);       
        if (generics == null) {
            generics =  new XmlSchemaComplexType(schema, true);
            generics.setName(typeName);
        }
       
        Class<?> genericsClass = m.getReturnType();
        buildGenericSeq(schema, generics, genericsClass)
         
        int idx = m.getName().startsWith("get") ? 3 : 2;
        String name = m.getName().substring(idx);
        name = Character.toLowerCase(name.charAt(0)) + name.substring(1);
        XmlSchemaElement newel = new XmlSchemaElement(schema, false);
        newel.setName(name);
        newel.setSchemaTypeName(generics.getQName());
        newel.setMinOccurs(0);
        if (!seq.getItems().contains(newel)) {
            seq.getItems().add(newel);
        }
    }
View Full Code Here

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

        }
        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

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

        assertValid("/b:root[@b:howdy='howdy']", element);

        XmlSchema schema = newXmlSchema("urn:Bean");
        type.writeSchema(schema);

        XmlSchemaComplexType stype = (XmlSchemaComplexType)schema.getTypeByName("bean");
        boolean howdy = false;
        boolean bleh = false;
        for (int x = 0; x < stype.getAttributes().size(); x++) {
            XmlSchemaObject o = stype.getAttributes().get(x);
            if (o instanceof XmlSchemaAttribute) {
                XmlSchemaAttribute a = (XmlSchemaAttribute)o;
                if ("howdy".equals(a.getName())) {
                    howdy = true;
                }
View Full Code Here

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

        assertValid("/b:root/b:bleh[@xsi:nil='true']", element);

        XmlSchema schema = newXmlSchema("urn:Bean");
        type.writeSchema(schema);

        XmlSchemaComplexType stype = (XmlSchemaComplexType)schema.getTypeByName("bean");
        XmlSchemaSequence seq = (XmlSchemaSequence) stype.getParticle();
        boolean howdy = false;
        boolean bleh = false;

        for (int x = 0; x < seq.getItems().size(); x++) {
            XmlSchemaSequenceMember o = seq.getItems().get(x);
            if (o instanceof XmlSchemaElement) {
                XmlSchemaElement a = (XmlSchemaElement)o;
                if ("bleh".equals(a.getName())) {
                    bleh = true;
                }
            }
        }

        for (int x = 0; x < stype.getAttributes().size(); x++) {
            XmlSchemaObject o = stype.getAttributes().get(x);
            if (o instanceof XmlSchemaAttribute) {
                XmlSchemaAttribute a = (XmlSchemaAttribute)o;
                if ("howdy".equals(a.getName())) {
                    howdy = true;
                }
View Full Code Here

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

        type.setSchemaType(new QName("urn:Bean", "bean"));

        XmlSchema schema = newXmlSchema("urn:Bean");
        type.writeSchema(schema);

        XmlSchemaComplexType btype = (XmlSchemaComplexType)schema.getTypeByName("bean");
        XmlSchemaSequence seq = (XmlSchemaSequence)btype.getParticle();
        boolean int1ok = false;
        boolean int2ok = false;
        for (int x = 0; x < seq.getItems().size(); x++) {
            XmlSchemaSequenceMember o = seq.getItems().get(x);
            if (o instanceof XmlSchemaElement) {
View Full Code Here

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

        type.setTypeMapping(mapping);

        XmlSchema schema = newXmlSchema("urn:Bean");
        type.writeSchema(schema);

        XmlSchemaComplexType btype = (XmlSchemaComplexType)schema.getTypeByName("BeanWithNillableItem");
        XmlSchemaSequence seq = (XmlSchemaSequence)btype.getParticle();
        boolean itemFound = false;
        boolean itemNotNillableFound = false;
        for (int x = 0; x < seq.getItems().size(); x++) {
            XmlSchemaSequenceMember o = seq.getItems().get(x);
            if (o instanceof XmlSchemaElement) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.