Package org.apache.cxf.aegis

Examples of org.apache.cxf.aegis.AegisContext.initialize()


        context = new AegisContext();
        context.setWriteXsiTypes(true);
        Set<java.lang.reflect.Type> rootClasses = new HashSet<java.lang.reflect.Type>();
        rootClasses.add(Zoo.class);
        context.setRootClasses(rootClasses);
        context.initialize();
        AegisWriter<XMLStreamWriter> writer = context.createXMLStreamWriter();
        FileOutputStream output = new FileOutputStream(outputPathname);
        XMLStreamWriter xmlWriter = outputFactory.createXMLStreamWriter(output);
        IndentingXMLStreamWriter indentWriter = new IndentingXMLStreamWriter(xmlWriter);
View Full Code Here


        context = new AegisContext();
        Set<Type> rootClasses = new HashSet<Type>();
        rootClasses.add(Zoo.class);
        context.setRootClasses(rootClasses);
        context.initialize();
        AegisReader<XMLStreamReader> reader = context.createXMLStreamReader();
        FileInputStream input = new FileInputStream(inputPathname);
        XMLStreamReader xmlReader = inputFactory.createXMLStreamReader(input);
        Zoo zoo = (Zoo)reader.read(xmlReader);
        System.out.println("Name " + zoo.getName());
View Full Code Here

    public void testInheritedMapping() throws Exception {
        BeanTypeInfo bti = new BeanTypeInfo(GregorianCalendar.class, "http://util.java");
        BeanType beanType = new BeanType(bti);
        beanType.setSchemaType(new QName("http://util.java{GregorianCalendar}"));
        AegisContext context = new AegisContext();
        context.initialize();
        TypeMapping mapping = context.getTypeMapping();
        // we are replacing the default mapping.
        mapping.register(beanType);
        Element root = new Element("dummySchema");
        beanType.writeSchema(root);
View Full Code Here

        addNamespace("b", "urn:Bean");
        addNamespace("a", "urn:anotherns");
        addNamespace("xsi", SOAPConstants.XSI_NS);

        AegisContext context = new AegisContext();
        context.initialize();
        mapping = context.getTypeMapping();

        // address type
        BeanTypeInfo addressInfo = new BeanTypeInfo(Address.class, "urn:Bean");
        addressInfo.setTypeMapping(mapping);
View Full Code Here

    }
   
    @Test
    public void testAnnotatedDefaultUnqualifiedAttribute() throws Exception {
        AegisContext context = new AegisContext();
        context.initialize();
        TypeMapping mapping = context.getTypeMapping();
       
        Type type = mapping.getTypeCreator().createType(AttributeBean.class);
        type.setSchemaType(new QName("urn:Bean", "bean"));
View Full Code Here

        AegisContext context = new AegisContext();
        TypeCreationOptions typeCreationOptions =
            new TypeCreationOptions();
        typeCreationOptions.setQualifyAttributes(true);
        context.setTypeCreationOptions(typeCreationOptions);
        context.initialize();
        TypeMapping mapping = context.getTypeMapping();
       
        Type type = mapping.getTypeCreator().createType(AttributeBean.class);
        type.setSchemaType(new QName("urn:Bean", "bean"));
View Full Code Here

        assertXPathEquals("/b:root/@pkg:attrPlainString", "attrPlain", element);
    }
    @Test
    public void testXmlDefaultUnqualifiedAttribute() throws Exception {
        AegisContext context = new AegisContext();
        context.initialize();
        TypeMapping mapping = context.getTypeMapping();
       
        Type type = mapping.getTypeCreator().createType(XmlMappedAttributeBean.class);
        type.setSchemaType(new QName("urn:Bean", "bean"));
View Full Code Here

        AegisContext context = new AegisContext();
        TypeCreationOptions typeCreationOptions =
            new TypeCreationOptions();
        typeCreationOptions.setQualifyAttributes(true);
        context.setTypeCreationOptions(typeCreationOptions);
        context.initialize();
        TypeMapping mapping = context.getTypeMapping();
       
        Type type = mapping.getTypeCreator().createType(XmlMappedAttributeBean.class);
        type.setSchemaType(new QName("urn:Bean", "bean"));
View Full Code Here

                context.setWriteXsiTypes(true); // needed, since we know no element/type maps.
                context.setReadXsiTypes(true);
                Set<Class<?>> rootClasses = new HashSet<Class<?>>();
                rootClasses.add(type);
                context.setRootClasses(rootClasses);
                context.initialize();
                classContexts.put(type, context);
            }
            return context;
        }
    }
View Full Code Here

        assertEquals("bleh", beanReader.getLocalName());
    }
   
    protected Context getContext() {
        AegisContext globalContext = new AegisContext();
        globalContext.initialize();
        globalContext.setTypeMapping(mapping);
        return new Context(globalContext);
    }

   
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.