Examples of XMLTypeCreator


Examples of org.codehaus.xfire.aegis.type.XMLTypeCreator

        // assertEquals(new QName(tm.getEncodingStyleURI(), "doubles"), type.getSchemaType());
    }

    public void testBestMatch() throws Exception
    {
        XMLTypeCreator creator = new XMLTypeCreator();
        creator.setNextCreator(new DefaultTypeCreator());
        creator.setConfiguration(new Configuration());
        tm = new CustomTypeMapping(new DefaultTypeMappingRegistry().createDefaultMappings());
        creator.setTypeMapping(tm);
        Method method = MyService1.class.getDeclaredMethod("getCollection", new Class[0]);
        Type type = creator.createType(method, -1);
        assertTrue("type is not a collection", type instanceof CollectionType);
        assertEquals("unexpected collection return type for method " + method, Double.class, ((CollectionType)type).getComponentType().getTypeClass());
       
        method = MyService1.class.getDeclaredMethod("getCollection", new Class[]{Integer.TYPE});
        type = creator.createType(method, -1);
        assertEquals("unexpected collection return type for method " + method, Float.class, ((CollectionType)type).getComponentType().getTypeClass());
       
        type = creator.createType(method, 0);
        // assertEquals(new QName("urn:foo:bar", "int"), type.getSchemaType());
       
        method = MyService1.class.getDeclaredMethod("getCollectionForValues", new Class[]{Integer.TYPE, Collection.class});
        type = creator.createType(method, -1);
        assertEquals("unexpected collection return type for method " + method, Calendar.class, ((CollectionType)type).getComponentType().getTypeClass());
       
        method = MyService1.class.getDeclaredMethod("getCollectionForValues", new Class[]{String.class, Collection.class});
        type = creator.createType(method, -1);
        assertEquals("unexpected collection return type for method " + method, BigDecimal.class, ((CollectionType)type).getComponentType().getTypeClass());
        type = creator.createType(method, 1);
        assertEquals("unexpected collection parameter type for method " + method, Date.class, ((CollectionType)type).getComponentType().getTypeClass());
        try
        {
            creator.createType(method, 2);
            fail("Expected exception when requesting type for non-existent parameter index");
        }
        catch(Exception ex)
        {}
    }
View Full Code Here

Examples of org.codehaus.xfire.aegis.type.XMLTypeCreator

    {
        super.setUp();

        DefaultTypeMappingRegistry reg = new DefaultTypeMappingRegistry();
        config = reg.getConfiguration();
        XMLTypeCreator creator = new XMLTypeCreator();
        creator.setConfiguration(reg.getConfiguration());
        Java5TypeCreator next = new Java5TypeCreator();
        next.setConfiguration(reg.getConfiguration());
        creator.setNextCreator(next);
        reg.createDefaultMappings();
        tm = (CustomTypeMapping) reg.getDefaultTypeMapping();
        tm.setTypeCreator(creator);
    }
View Full Code Here

Examples of org.codehaus.xfire.aegis.type.XMLTypeCreator

    {
        super();
       
        setConfiguration(configuration);
       
        XMLTypeCreator xc = new XMLTypeCreator();
        xc.setNextCreator(new DefaultTypeCreator(getConfiguration()));
        xc.setConfiguration(getConfiguration());
        setNextCreator(xc);
    }
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.