Package org.apache.cxf.aegis.type

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


     * @param mappingNamespaceURI URI to select mappings based on the encoding.
     */
    public void initialize() {
        // allow spring config of an alternative mapping.
        if (configuration == null) {
            configuration = new TypeCreationOptions();
        }
        if (typeMapping == null) {
            boolean defaultNillable = configuration.isDefaultNillable();
            TypeMapping baseTM = DefaultTypeMapping.createDefaultTypeMapping(defaultNillable,
                                                                             mtomUseXmime,
View Full Code Here


    }

    @Test
    public void testType() {
        AnnotatedTypeInfo info = new AnnotatedTypeInfo(tm, JaxbBean1.class, "urn:foo",
                                                       new TypeCreationOptions());

        Iterator<QName> elements = info.getElements().iterator();
        assertTrue(elements.hasNext());
        QName element = elements.next();
        assertTrue(elements.hasNext());
View Full Code Here

    }

    @Test
    public void testGetSetRequired() throws Exception {
        BeanType type = new BeanType(new AnnotatedTypeInfo(tm, BadBean.class, "urn:foo",
                                                           new TypeCreationOptions()));
        type.setSchemaType(new QName("urn:foo", "BadBean"));

        assertEquals(0, type.getTypeInfo().getElements().size());
    }
View Full Code Here

    public void setUp() throws Exception {
        super.setUp();

        tm = new DefaultTypeMapping(Constants.URI_2001_SCHEMA_XSD);
        creator = new Java5TypeCreator();
        creator.setConfiguration(new TypeCreationOptions());
        tm.setTypeCreator(creator);
    }
View Full Code Here

    @Test
    public void testCollectionDTO() {
        tm = new DefaultTypeMapping(Constants.URI_2001_SCHEMA_XSD);
        creator = new Java5TypeCreator();
        creator.setConfiguration(new TypeCreationOptions());
        tm.setTypeCreator(creator);

        AegisType dto = creator.createType(CollectionDTO.class);
        Set<AegisType> deps = dto.getDependencies();
View Full Code Here

    @Test
    public void testObjectDTO() {
        tm = new DefaultTypeMapping(Constants.URI_2001_SCHEMA_XSD);
        creator = new Java5TypeCreator();
        creator.setConfiguration(new TypeCreationOptions());
        tm.setTypeCreator(creator);

        AegisType dto = creator.createType(ObjectDTO.class);
        Set<AegisType> deps = dto.getDependencies();
View Full Code Here

     * @param mappingNamespaceURI URI to select mappings based on the encoding.
     */
    public void initialize() {
        // allow spring config of an alternative mapping.
        if (configuration == null) {
            configuration = new TypeCreationOptions();
        }
        if (typeMapping == null) {
            boolean defaultNillable = configuration.isDefaultNillable();
            TypeMapping baseTM = DefaultTypeMapping.createDefaultTypeMapping(defaultNillable,
                                                                             mtomUseXmime,
View Full Code Here

            Qi4jTypeCreator qi4jTypeCreator = obf.newObject( Qi4jTypeCreator.class );

            AegisContext aegisContext = dataBinding.getAegisContext();
            TypeMapping typeMapping = aegisContext.getTypeMapping();
            AbstractTypeCreator defaultCreator = (AbstractTypeCreator) typeMapping.getTypeCreator();
            TypeCreationOptions configuration = defaultCreator.getConfiguration();
            qi4jTypeCreator.setConfiguration( configuration );
            qi4jTypeCreator.setNextCreator( defaultCreator );
            qi4jTypeCreator.setTypeMapping( typeMapping );
        }
View Full Code Here

    @Override
    protected AegisContext getAegisContext(Class<?> plainClass, Type genericType) {
        AegisContext context = new AegisContext();
        context.setWriteXsiTypes(writeXsiType);
        context.setReadXsiTypes(readXsiType);
        TypeCreationOptions tco = new TypeCreationOptions();
        tco.setQualifyElements(false);
        Set<java.lang.reflect.Type> rootClasses = new HashSet<java.lang.reflect.Type>();
        rootClasses.add(genericType);
        context.setTypeCreationOptions(tco);
        context.setRootClasses(rootClasses);
        TypeMapping baseMapping = DefaultTypeMapping.createSoap11TypeMapping(true, false, false);
View Full Code Here

    }

    @Test
    public void testNillableAnnotation() throws Exception {
        context = new AegisContext();
        TypeCreationOptions config = new TypeCreationOptions();
        config.setDefaultNillable(false);
        config.setDefaultMinOccurs(1);
        context.setTypeCreationOptions(config);
        context.initialize();
        mapping = context.getTypeMapping();

        BeanType type = (BeanType)mapping.getTypeCreator().createType(BeanWithNillableItem.class);
View Full Code Here

TOP

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

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.