Package org.apache.cxf.aegis.type

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


            = testUtilities.getResourceAsXMLStreamReader("topLevelList.xml");
        AegisReader<XMLStreamReader> reader = context.createXMLStreamReader();
        // until I fix type mapping to use java.lang.reflect.Type instead of
        // Class, I need to do the following
        QName magicTypeQName = new QName("urn:org.apache.cxf.aegis.types", "ArrayOfString");
        AegisType aegisRegisteredType = context.getTypeMapping().getType(magicTypeQName);

        Object something = reader.read(streamReader, aegisRegisteredType);
        List<String> correctAnswer = new ArrayList<String>();
        correctAnswer.add("cat");
        correctAnswer.add("dog");
View Full Code Here


    @Test
    public void testType() throws Exception {
        Method m = CustomTypeService.class.getMethod("doFoo", new Class[] {String.class});

        AegisType type = creator.createType(m, 0);
        tm.register(type);
        assertTrue(type instanceof CustomStringType);
        //assertEquals(new QName("urn:xfire:foo", "custom"), type.getSchemaType());

        type = creator.createType(m, -1);
        tm.register(type);
        assertTrue(type instanceof CustomStringType);
        assertEquals(new QName("urn:xfire:foo", "custom"), type.getSchemaType());
    }
View Full Code Here

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

        AegisType 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);
        AegisType 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);
        AegisType 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);
        AegisType 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);
        AegisType 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);
        AegisType type = tm.getTypeCreator().createType(AnnotatedBean1.class);
        BeanTypeInfo info = ((BeanType)type).getTypeInfo();
        assertFalse(info.isExtensibleElements());
        assertFalse(info.isExtensibleAttributes());
    }
View Full Code Here

            if (sparse == null) {
                sparse = position != null;
            }

            // nested element names can specify a type
            AegisType compType = getTypeMapping().getType(creader.getName());
            if (compType == null) {
                // use the type declared in the arrayType attribute
                compType = arrayTypeInfo.getType();
            }
            // check for an xsi:type override
            compType = TypeUtil.getReadType(creader.getXMLStreamReader(),
                                            context.getGlobalContext(), compType);

            // wrap type with soap ref to handle hrefs
            compType = new SoapRefType(compType);

            // read the value
            Object value;
            if (creader.isXsiNil()) {
                value = null;
                creader.readToEnd();
            } else {
                value = compType.readObject(creader, context);
            }

            // add the value
            if (!sparse) {
                if (values.size() + 1 > maxSize) {
View Full Code Here

        if (values == null) {
            return;
        }

        // ComponentType
        AegisType type = getComponentType();
        if (type == null) {
            throw new DatabindingException("Couldn't find component type for array.");
        }

        // Root component's schema type
View Full Code Here

TOP

Related Classes of org.apache.cxf.aegis.type.AegisType

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.