Examples of AegisType


Examples of org.apache.cxf.aegis.type.AegisType

        type.setTypeClass(ByteBean.class);
        type.setTypeMapping(mapping);
        type.setSchemaType(new QName("urn:Bean", "bean"));

        QName name = new QName("urn:Bean", "data");
        AegisType dataType = type.getTypeInfo().getType(name);
        assertNotNull(dataType);

        assertTrue(type.getTypeInfo().isNillable(name));

        ByteBean bean = new ByteBean();
View Full Code Here

Examples of org.apache.cxf.aegis.type.AegisType

        BeanType type = new BeanType();
        type.setTypeClass(SerializableBean.class);
        type.setTypeMapping(mapping);
        type.setSchemaType(new QName("urn:foo", "SerializableBean"));

        AegisType stringType = mapping.getType(String.class);
        assertTrue(type.getDependencies().contains(stringType));

        type = new BeanType();
        type.setTypeClass(CloneableBean.class);
        type.setTypeMapping(mapping);
View Full Code Here

Examples of org.apache.cxf.aegis.type.AegisType

        type.setTypeClass(ByteBean.class);
        type.setTypeMapping(mapping);
        type.setSchemaType(new QName("urn:Bean", "bean"));

        QName name = new QName("urn:Bean", "data");
        AegisType dataType = type.getTypeInfo().getType(name);
        assertNotNull(dataType);

        assertTrue(type.getTypeInfo().isNillable(name));

        ByteBean bean = new ByteBean();
View Full Code Here

Examples of org.apache.cxf.aegis.type.AegisType

                    while (entryReader.hasMoreElementReaders()) {

                        MessageReader evReader = entryReader.getNextElementReader();

                        if (evReader.getName().equals(getKeyName())) {
                            AegisType kType = TypeUtil.getReadType(evReader.getXMLStreamReader(),
                                                              context.getGlobalContext(),
                                                              getKeyType());
                            key = kType.readObject(evReader, context);
                        } else if (evReader.getName().equals(getValueName())) {
                            AegisType vType = TypeUtil.getReadType(evReader.getXMLStreamReader(),
                                                              context.getGlobalContext(),
                                                              getValueType());
                            value = vType.readObject(evReader, context);
                        } else {
                            readToEnd(evReader);
                        }
                    }
View Full Code Here

Examples of org.apache.cxf.aegis.type.AegisType

        }

        try {
            Map map = (Map)object;

            AegisType kType = getKeyType();
            AegisType vType = getValueType();

            for (Iterator itr = map.entrySet().iterator(); itr.hasNext();) {
                Map.Entry entry = (Map.Entry)itr.next();

                writeEntry(writer, context, kType, vType, entry);
View Full Code Here

Examples of org.apache.cxf.aegis.type.AegisType

        root.addType(complex);
        root.getItems().add(complex);
        XmlSchemaSequence sequence = new XmlSchemaSequence();
        complex.setParticle(sequence);

        AegisType kType = getKeyType();
        AegisType vType = getValueType();
       
        XmlSchemaElement element = new XmlSchemaElement();
        sequence.getItems().add(element);
        element.setName(getEntryName().getLocalPart());
        element.setMinOccurs(0);
View Full Code Here

Examples of org.apache.cxf.aegis.type.AegisType

            return;
        }
        for (Iterator itr = container.getMessageParts().iterator(); itr.hasNext();) {
            MessagePartInfo part = (MessagePartInfo)itr.next();

            AegisType type = getParameterType(s, serviceTM, part, partType);

            if (part.getXmlSchema() == null) {
                // schema hasn't been filled in yet
                if (type.isAbstract()) {
                    part.setTypeQName(type.getSchemaType());
                } else {
                    part.setElementQName(type.getSchemaType());
                }
            }
           
            Annotation[] anns = part.getProperty("parameter.annotations", Annotation[].class);

            long miValue = -1;
            if (type.hasMinOccurs()) {
                miValue = type.getMinOccurs();
            }
            Integer i = AnnotationReader.getMinOccurs(anns);
            if (i != null) {
                miValue = i;
            }
            if (miValue > 0) {
                part.setProperty("minOccurs", Long.toString(miValue));
            }

           
            // The concept of type.isNillable is questionable: how are types nillable?
            // However, this if at least allow .aegis.xml files to get control.
            if (part.getProperty("nillable") == null) {
                boolean isNil = type.isNillable();
                Boolean b = AnnotationReader.isNillable(anns);
                if (b != null || (miValue != 0 && isNil)) {
                    part.setProperty("nillable", b == null ? isNil : b);
                }
                /*
                if (miValue == -1 && (b == null ? isNil : b)) {
                    part.setProperty("minOccurs", "1");
                }
                */
            }
            if (type.hasMaxOccurs()) {
                String moValue;
                long mo = type.getMaxOccurs();
                if (mo != Long.MAX_VALUE) {
                    moValue = Long.toString(mo);
                    part.setProperty("maxOccurs", moValue);
                }
            }
View Full Code Here

Examples of org.apache.cxf.aegis.type.AegisType

        if (isFlat()) {
            // the reader does some really confusing things.
            XMLStreamReader xmlReader = reader.getXMLStreamReader();
            while (xmlReader.getName().equals(flatElementName)) {
                AegisType compType = TypeUtil.getReadType(reader.getXMLStreamReader(),
                                                     context.getGlobalContext(), getComponentType());
                // gosh, what about message readers of some other type?
                ElementReader thisItemReader = new ElementReader(xmlReader);
                collectOneItem(context, values, thisItemReader, compType);
            }
        } else {
            while (reader.hasMoreElementReaders()) {
                MessageReader creader = reader.getNextElementReader();
                AegisType compType = TypeUtil.getReadType(creader.getXMLStreamReader(),
                                                     context.getGlobalContext(), getComponentType());
                collectOneItem(context, values, creader, compType);
            }
        }
View Full Code Here

Examples of org.apache.cxf.aegis.type.AegisType

        if (values instanceof Collection) {
            Collection c = (Collection)values;
            values = c.toArray();
        }

        AegisType type = getComponentType();
        if (type == null) {
            throw new DatabindingException("Couldn't find type for array.");
        }
        if (XmlSchemaConstants.ANY_TYPE_QNAME.equals(type.getSchemaType())) {
            forceXsiWrite = true;
        }

        String ns = null;
        if (type.isAbstract()) {
            ns = getSchemaType().getNamespaceURI();
        } else {
            ns = type.getSchemaType().getNamespaceURI();
        }

        /*
         * This is not the right name in the 'flat' case. In the flat case,
         * we need the element name that would have been attached
         * one level out.
         */
        String name;
       
        if (isFlat()) {
            name = flatElementName.getLocalPart();
            ns = flatElementName.getNamespaceURI(); // override the namespace.
        } else {
            name = type.getSchemaType().getLocalPart();
        }

        Class arrayType = type.getTypeClass();

        boolean oldXsiWrite = context.getGlobalContext().isWriteXsiTypes();
        try {
            if (forceXsiWrite) {
                context.getGlobalContext().setWriteXsiTypes(true);
View Full Code Here

Examples of org.apache.cxf.aegis.type.AegisType

        QName name = tm.getTypeCreator().getElementName(m, param);

        // No mapped name was specified, so if its a complex type use that name
        // instead
        if (name == null) {
            AegisType type = tm.getTypeCreator().createType(m, param);

            if (type.isComplex() && !type.isAbstract()) {
                name = type.getSchemaType();
            }
        }

        return name;
    }
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.