Package org.apache.cxf.aegis.type.basic

Examples of org.apache.cxf.aegis.type.basic.BeanTypeInfo


    @Test
    public void testNillableDefaultTrue() throws Exception {
        config.setDefaultNillable(true);

        Type type = tm.getTypeCreator().createType(AnnotatedBean1.class);
        BeanTypeInfo info = ((BeanType)type).getTypeInfo();

        assertTrue(info.isNillable(new QName(info.getDefaultNamespace(), "bogusProperty")));
    }
View Full Code Here


    @Test
    public void testNillableDefaultFalse() throws Exception {
        config.setDefaultNillable(false);
        Type type = tm.getTypeCreator().createType(AnnotatedBean1.class);
        BeanTypeInfo info = ((BeanType)type).getTypeInfo();

        assertFalse(info.isNillable(new QName(info.getDefaultNamespace(), "bogusProperty")));
    }
View Full Code Here

    @Test
    public void testMinOccursDefault0() throws Exception {
        config.setDefaultMinOccurs(0);
        Type type = tm.getTypeCreator().createType(AnnotatedBean1.class);
        BeanTypeInfo info = ((BeanType)type).getTypeInfo();

        assertEquals(info.getMinOccurs(new QName(info.getDefaultNamespace(), "bogusProperty")), 0);
    }
View Full Code Here

    @Test
    public void testMinOccursDefault1() throws Exception {
        config.setDefaultMinOccurs(1);
        Type type = tm.getTypeCreator().createType(AnnotatedBean1.class);
        BeanTypeInfo info = ((BeanType)type).getTypeInfo();

        assertEquals(info.getMinOccurs(new QName(info.getDefaultNamespace(), "bogusProperty")), 1);
    }
View Full Code Here

    @Test
    public void testExtensibleDefaultTrue() throws Exception {
        config.setDefaultExtensibleElements(true);
        config.setDefaultExtensibleAttributes(true);
        Type type = tm.getTypeCreator().createType(AnnotatedBean1.class);
        BeanTypeInfo info = ((BeanType)type).getTypeInfo();
        assertTrue(info.isExtensibleElements());
        assertTrue(info.isExtensibleAttributes());
    }
View Full Code Here

    @Test
    public void testExtensibleDefaultFalse() throws Exception {
        config.setDefaultExtensibleElements(false);
        config.setDefaultExtensibleAttributes(false);
        Type type = tm.getTypeCreator().createType(AnnotatedBean1.class);
        BeanTypeInfo info = ((BeanType)type).getTypeInfo();
        assertFalse(info.isExtensibleElements());
        assertFalse(info.isExtensibleAttributes());
    }
View Full Code Here

        setSchemaType(QNAME);
    }

    @Override
    public Object readObject(MessageReader reader, Context context) throws DatabindingException {
        BeanTypeInfo inf = getTypeInfo();

        try {
            String id = null;
            String name = null;

            // Read child elements
            while (reader.hasMoreElementReaders()) {
                MessageReader childReader = reader.getNextElementReader();
                if (childReader.isXsiNil()) {
                    childReader.readToEnd();
                    continue;
                }
                QName qName = childReader.getName();
                Type defaultType = inf.getType(qName);
                Type type = TypeUtil.getReadType(childReader.getXMLStreamReader(),
                                                 context.getGlobalContext(), defaultType);
                if (type != null) {
                    String value = (String)type.readObject(childReader, context);
                    if ("id".equals(qName.getLocalPart())) {
View Full Code Here

        setSchemaType(QNAME);
    }

    @Override
    public Object readObject(MessageReader reader, Context context) throws DatabindingException {
        BeanTypeInfo inf = getTypeInfo();

        try {
            String key = null;

            // Read child elements
            while (reader.hasMoreElementReaders()) {
                MessageReader childReader = reader.getNextElementReader();
                if (childReader.isXsiNil()) {
                    childReader.readToEnd();
                    continue;
                }
                QName name = childReader.getName();
                Type defaultType = inf.getType(name);
                Type type = TypeUtil.getReadType(childReader.getXMLStreamReader(),
                                                 context.getGlobalContext(), defaultType);
                if (type != null) {
                    String value = (String)type.readObject(childReader, context);
                    if ("key".equals(name.getLocalPart())) {
View Full Code Here

        BeanType type = new BeanType();
        type.setSchemaType(createQName(info.getTypeClass()));
        type.setTypeClass(info.getTypeClass());
        type.setTypeMapping(getTypeMapping());

        BeanTypeInfo typeInfo = type.getTypeInfo();
        typeInfo.setDefaultMinOccurs(getConfiguration().getDefaultMinOccurs());
        typeInfo.setExtensibleAttributes(getConfiguration().isDefaultExtensibleAttributes());
        typeInfo.setExtensibleElements(getConfiguration().isDefaultExtensibleElements());

        return type;
    }
View Full Code Here

TOP

Related Classes of org.apache.cxf.aegis.type.basic.BeanTypeInfo

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.