Package org.apache.cxf.aegis

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


            AegisContext context = classContexts.get(type);
            if (context == null) {
                context = new AegisContext();
                Set<Class<?>> rootClasses = new HashSet<Class<?>>();
                context.setRootClasses(rootClasses);
                context.initialize();
                classContexts.put(type, context);
            }
            return context;
        }
    }
View Full Code Here


                    rootClasses.add(type);
                } else {
                    addType(rootClasses, reflectionType, true);
                }
                context.setRootClasses(rootClasses);
                context.initialize();
                /* It's not enough, in the presence of generic types, to just add it as a root.
                    a mapping is also needed */
                if (reflectionType != null) {
                    org.apache.cxf.aegis.type.Type aegisType;
                    aegisType = context.getTypeMapping().getTypeCreator().createType(reflectionType);
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

    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);
        XmlSchema schema = newXmlSchema("http://util.java");
        beanType.writeSchema(schema);
View Full Code Here

    }

    @Test
    public void testAegisTypeSchema() throws Exception {
        AegisContext context = new AegisContext();
        context.initialize();
        XmlSchemaCollection collection = new XmlSchemaCollection();
        context.addTypesSchemaDocument(collection);
        XmlSchema[] schemas = collection.getXmlSchemas();
        XmlSchema typeSchema = null;
        for (XmlSchema schema : schemas) {
View Full Code Here

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

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

   
View Full Code Here

        super.setUp();

        AegisContext context = new AegisContext();
        config = new TypeCreationOptions();
        context.setTypeCreationOptions(config);
        context.initialize();
        XMLTypeCreator creator = new XMLTypeCreator();
        creator.setConfiguration(config);
        Java5TypeCreator next = new Java5TypeCreator();
        next.setConfiguration(config);
        creator.setNextCreator(next);
View Full Code Here


    @Test
    public void testBadDescriptorNS() throws Exception {
        AegisContext context = new AegisContext();
        context.initialize();
        mapping = context.getTypeMapping();
        try {
            mapping.getTypeCreator().createType(BadBeanDescriptor.class);
            fail("No exception was thrown");
        } catch (DatabindingException e) {
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.