Package org.apache.cxf.aegis

Examples of org.apache.cxf.aegis.Context


        if (type == null) {
            throw new Fault(new Message("NO_MESSAGE_FOR_PART", LOG, part));
        }
       
        Context context = new Context(databinding.getAegisContext());
       
        context.setAttachments(attachments);
        type = TypeUtil.getWriteType(databinding.getAegisContext(), obj, type);
       
        try {
            if (obj == null) {
                if (part.getXmlSchema() instanceof XmlSchemaElement
View Full Code Here


        type.setTypeMapping(mapping);
        type.setSchemaType(new QName("urn:Bean", "bean"));

        // Test reading
        ElementReader reader = new ElementReader(getResourceAsStream("bean9.xml"));
        Context ctx = getContext();
        ctx.getGlobalContext().setReadXsiTypes(false);

        SimpleBean bean = (SimpleBean)type.readObject(reader, ctx);
        assertEquals("bleh", bean.getBleh());
        assertEquals("howdy", bean.getHowdy());
View Full Code Here

        type.setTypeMapping(mapping);
        type.setSchemaType(new QName("urn:Bean", "bean"));

        // Test reading
        ElementReader reader = new ElementReader(getResourceAsStream("bean9.xml"));
        Context ctx = getContext();
        ctx.getGlobalContext().setReadXsiTypes(false);

        SimpleBean bean = (SimpleBean)type.readObject(reader, ctx);
        assertEquals("bleh", bean.getBleh());
        assertEquals("howdy", bean.getHowdy());
View Full Code Here

        type.setTypeMapping(mapping);
        type.setSchemaType(new QName("urn:Bean", "bean"));

        // Test reading
        ElementReader reader = new ElementReader(getResourceAsStream("bean9.xml"));
        Context ctx = getContext();
        ctx.getGlobalContext().setReadXsiTypes(false);

        SimpleBean bean = (SimpleBean)type.readObject(reader, ctx);
        assertEquals("bleh", bean.getBleh());
        assertEquals("howdy", bean.getHowdy());
View Full Code Here

   
    protected Context getContext() {
        AegisContext globalContext = new AegisContext();
        globalContext.initialize();
        globalContext.setTypeMapping(mapping);
        return new Context(globalContext);
    }
View Full Code Here

   
    protected Context getContext() {
        AegisContext globalContext = new AegisContext();
        globalContext.initialize();
        globalContext.setTypeMapping(mapping);
        return new Context(globalContext);
    }
View Full Code Here

        globalContext.setTypeMapping(mapping);
        return new Context(globalContext);
    }

    public <T> T readWriteReadRef(String file, Class<T> typeClass) throws XMLStreamException {
        Context context = getContext();
       
        AegisType type = mapping.getType(typeClass);
        assertNotNull("no type found for " + typeClass.getName());

        // read file
View Full Code Here

            throw new RuntimeException(e);
        }
    }

    public Object readRef(ElementReader root) throws XMLStreamException {
        Context context = getContext();

        // get AegisType based on the element qname
        MessageReader reader = root.getNextElementReader();
        AegisType type = this.mapping.getType(reader.getName());
        assertNotNull("type is null", type);
View Full Code Here

        // we should not add the out namespace here, as it is not a part of root element
        /*for (Map.Entry<String, String> entry : getNamespaces().entrySet()) {
            namespaces.addNamespace(entry.getKey(), entry.getValue());
        }*/
        ElementWriter rootWriter = getElementWriter(element, namespaces);
        Context context = getContext();

        // get AegisType based on the object instance
        assertNotNull("type is null", type);

        // write the ref
View Full Code Here

    public void verifyInvalid(String resourceName, Class<?> expectedType) throws XMLStreamException {
        AegisType type = mapping.getType(expectedType);
        assertNotNull("type is null", type);

        Context context = getContext();

        ElementReader reader = new ElementReader(getClass().getResourceAsStream(resourceName));
        try {
            type.readObject(reader, context);
            fail("expected DatabindingException");
View Full Code Here

TOP

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

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.