Package org.apache.cxf.aegis

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


    Server server;

    @Before
    public void startServer() throws Exception {
        AegisContext context = new AegisContext();
        context.initialize();
        context.getTypeMapping().register(new ClassAsStringType());
       
        ServerFactoryBean b = new ServerFactoryBean();
        b.setDataBinding(new AegisDatabinding(context));
        b.setServiceClass(GenericsService.class);
View Full Code Here


        // create a different mapping than the context creates.
        TypeMapping baseMapping = DefaultTypeMapping.createSoap11TypeMapping(true, false, false);
        mapping = new DefaultTypeMapping(Constants.URI_2001_SCHEMA_XSD, baseMapping);
        mapping.setTypeCreator(context.createTypeCreator());
        context.setTypeMapping(mapping);
        context.initialize();
        // serialization root type
        trailingBlocks = new TrailingBlocks();
    }
   
    protected Context getContext() {
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

        trailingBlocks = new TrailingBlocks();
    }
   
    protected Context getContext() {
        AegisContext globalContext = new AegisContext();
        globalContext.initialize();
        globalContext.setTypeMapping(mapping);
        return new Context(globalContext);
    }

    public <T> T readWriteReadRef(String file, Class<T> typeClass) throws XMLStreamException {
View Full Code Here

        addNamespace("b", "urn:Bean");
        addNamespace("a", "urn:anotherns");
        addNamespace("xsi", Constants.URI_2001_SCHEMA_XSI);

        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

        context = new AegisContext();
        context.setWriteXsiTypes(true);
        Set<Class<?>> rootClasses = new HashSet<Class<?>>();
        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();
        context.setWriteXsiTypes(true);
        Set<Class<?>> rootClasses = new HashSet<Class<?>>();
        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<Class<?>> rootClasses = new HashSet<Class<?>>();
        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

        DefaultTypeMapping mapping = new DefaultTypeMapping(SOAPConstants.XSD, baseMapping);
        TypeCreator stockTypeCreator = createTypeCreator(tco);

        mapping.setTypeCreator(stockTypeCreator);
        context.setTypeMapping(mapping);
        context.initialize();
        return context;
    }
}
View Full Code Here

                context.setWriteXsiTypes(writeXsiType);
                context.setReadXsiTypes(readXsiType);
                Set<java.lang.reflect.Type> rootClasses = new HashSet<java.lang.reflect.Type>();
                rootClasses.add(reflectionType);
                context.setRootClasses(rootClasses);
                context.initialize();
                classContexts.put(reflectionType, context);
            }
            return context;
        }
    }
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.