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));
        }


        Context context = new Context(databinding.getAegisContext());

        context.setAttachments(attachments);
        type = TypeUtil.getWriteType(databinding.getAegisContext(), obj, type);
        try {
            W3CDOMStreamWriter domWriter = new W3CDOMStreamWriter(output);
            ElementWriter writer = new ElementWriter(domWriter);
            MessageWriter w2 = writer.getElementWriter(part.getConcreteName());
View Full Code Here


                    throw new Fault(e);
                }
            }
        }
       
        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

        Map<String, Object> props = (Endpoint)getProperty(ENDPOINT);
        if (props == null) {
            props = new HashMap<String, Object>();
        }
        Context context = new Context(props);

        // I'm not sure that this is the right type mapping
        context.setTypeMapping(type.getTypeMapping());
        context.setOverrideTypes(CastUtils.cast(databinding.getOverrideTypes(), String.class));
        context.setAttachments(attachments);
        Object val = databinding.getService().get(AegisDatabinding.WRITE_XSI_TYPE_KEY);
        if ("true".equals(val) || Boolean.TRUE.equals(val)) {
            context.setWriteXsiTypes(true);
        }

        type = TypeUtil.getWriteType(context, obj, type);
        try {
            W3CDOMStreamWriter domWriter = new W3CDOMStreamWriter(output);
View Full Code Here

        Map<String, Object> props = (Endpoint)getProperty(ENDPOINT);
        if (props == null) {
            props = new HashMap<String, Object>();
        }
        Context context = new Context(props);
       
        // I'm not sure that this is the right type mapping
        context.setTypeMapping(type.getTypeMapping());
        context.setOverrideTypes(CastUtils.cast(databinding.getOverrideTypes(), String.class));
        context.setAttachments(attachments);
        Object val = databinding.getService().get(AegisDatabinding.WRITE_XSI_TYPE_KEY);
        if ("true".equals(val) || Boolean.TRUE.equals(val)) {
            context.setWriteXsiTypes(true);
        }
       
        type = TypeUtil.getWriteType(context, obj, type);
       
        try {
View Full Code Here

    private Map<String, Object> properties;
   
    public XMLStreamDataReader(AegisDatabinding databinding) {
        this.databinding = databinding;
        this.context = new Context(false);
    }
View Full Code Here

        tm.register(type);

        Element root = new Element("root");
        JDOMWriter writer = new JDOMWriter(root);

        type.writeObject(smallEnum.VALUE1, writer, new Context());

        assertEquals("VALUE1", root.getValue());

        JDOMReader reader = new JDOMReader(root);
        Object value = type.readObject(reader, new Context());

        assertEquals(smallEnum.VALUE1, value);
    }
View Full Code Here

        tm.register(type);

        Element root = new Element("root");
        JDOMWriter writer = new JDOMWriter(root);

        type.writeObject(new EnumBean(), writer, new Context());

        JDOMReader reader = new JDOMReader(root);
        Object value = type.readObject(reader, new Context());

        assertTrue(value instanceof EnumBean);
        EnumBean bean = (EnumBean)value;
        assertNull(bean.getCurrency());
    }
View Full Code Here

        type.setTypeClass(IMyInterface.class);
        type.setTypeMapping(mapping);
        type.setSchemaType(new QName("urn:MyInterface", "data"));

        ElementReader reader = new ElementReader(getResourceAsStream("MyInterface.xml"));
        IMyInterface data = (IMyInterface)type.readObject(reader, new Context());
        assertEquals("junk", data.getName());
        assertEquals(true, data.isUseless());
        data.setName("bigjunk");
        data.setUseless(false);
        assertEquals("bigjunk", data.getName());
View Full Code Here

        type.setTypeClass(IMyInterface.class);
        type.setTypeMapping(mapping);
        type.setSchemaType(new QName("urn:MyInterface", "data"));

        ElementReader reader = new ElementReader(getResourceAsStream("MyInterface.xml"));
        IMyInterface data = (IMyInterface)type.readObject(reader, new Context());

        try {
            data.getNameById(0);
            fail(IllegalAccessError.class + " should be thrown.");
        } catch (IllegalAccessError e) {
View Full Code Here

        type.setTypeClass(IMyInterface.class);
        type.setTypeMapping(mapping);
        type.setSchemaType(new QName("urn:MyInterface", "data"));

        ElementReader reader = new ElementReader(getResourceAsStream("MyInterface.xml"));
        IMyInterface data = (IMyInterface)type.readObject(reader, new Context());

        try {
            data.setNameNoParams();
            fail(IllegalAccessError.class + " should be thrown.");
        } catch (IllegalAccessError e) {
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.