Package org.apache.cxf.aegis

Examples of org.apache.cxf.aegis.AegisContext


        assertTrue(int2ok);
    }

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


    }


    @Test
    public void testNillableIntMinOccurs1() throws Exception {
        context = new AegisContext();
        TypeCreationOptions config = new TypeCreationOptions();
        config.setDefaultMinOccurs(1);
        config.setDefaultNillable(false);
        context.setTypeCreationOptions(config);
        context.initialize();
View Full Code Here

            type = obj.getClass();
        }
        if (genericType == null) {
            genericType = type;
        }
        AegisContext context = getAegisContext(type, genericType);
        AegisType aegisType = context.getTypeMapping().getType(genericType);
        AegisWriter<XMLStreamWriter> aegisWriter = context.createXMLStreamWriter();
        try {
            W3CDOMStreamWriter w3cStreamWriter = new W3CDOMStreamWriter();
            XMLStreamWriter spyingWriter = new PrefixCollectingXMLStreamWriter(w3cStreamWriter,
                                                                               namespaceMap);
            spyingWriter.writeStartDocument();
View Full Code Here

        xmlInputFactory = XMLInputFactory.newInstance();
    }
   
    @Test
    public void testTypeLookup() throws Exception {
        context = new AegisContext();
        context.initialize();
        AegisType st = context.getTypeMapping().getType(new QName(XMLConstants.W3C_XML_SCHEMA_NS_URI,
                                                             "string"));
        assertNotNull(st);
        assertEquals(st.getClass(), StringType.class);
View Full Code Here

        assertEquals(st.getClass(), StringType.class);
    }
   
    @Test
    public void testBasicTypeWrite() throws Exception {
        context = new AegisContext();
        context.initialize();
        AegisWriter<XMLStreamWriter> writer = context.createXMLStreamWriter();
        StringWriter stringWriter = new StringWriter();
        XMLStreamWriter xmlWriter = xmlOutputFactory.createXMLStreamWriter(stringWriter);
        writer.write("ball-of-yarn",
View Full Code Here

        assertEquals("ball-of-yarn", text);
    }
   
    @Test
    public void testWriteCollection() throws Exception {
        context = new AegisContext();
        context.setWriteXsiTypes(true);
        context.initialize();
        List<String> strings = new ArrayList<String>();
        strings.add("cat");
        strings.add("dog");
View Full Code Here

        assertEquals("hailstorm", text);
    }
   
    @Test
    public void testBean() throws Exception {
        context = new AegisContext();
        Set<java.lang.reflect.Type> rootClasses = new HashSet<java.lang.reflect.Type>();
        rootClasses.add(SimpleBean.class);
        context.setRootClasses(rootClasses);
        context.initialize();
        SimpleBean sb = new SimpleBean();
View Full Code Here

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

        context = new AegisContext();
        context.initialize();
        mapping = context.getTypeMapping();
    }
View Full Code Here

                        + "/xsd:element[@name='int2'][@nillable='true']",
                      schema);
    }
    @Test
    public void testNillableIntMinOccurs1() throws Exception {
        context = new AegisContext();

        TypeCreationOptions config = new TypeCreationOptions();
        config.setDefaultMinOccurs(1);
        config.setDefaultNillable(false);
        context.setTypeCreationOptions(config);
View Full Code Here

     * be usable even if that API is never called.
     */
    private void ensureInitialized() {
        if (!isInitialized) {
            if (aegisContext == null) {
                aegisContext = new AegisContext();
                if (overrideTypes != null) {
                    aegisContext.setRootClassNames(overrideTypes);
                }
                if (configuration != null) {
                    aegisContext.setTypeCreationOptions(configuration);
View Full Code Here

TOP

Related Classes of org.apache.cxf.aegis.AegisContext

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.