Package org.apache.cxf.aegis.type

Examples of org.apache.cxf.aegis.type.Type.writeObject()


        Context messageContext = new Context(context);
        Element element = new Element("root", "b", "urn:Bean");
        new Document(element);
        AttributeBean bean = new AttributeBean();
        type.writeObject(bean, new JDOMWriter(element), messageContext);
        assertValid("/b:root[@xyzzy:attrExplicitString]", element);
        assertXPathEquals("/b:root/@xyzzy:attrExplicitString", "attrExplicit", element);
        assertValid("/b:root[@pkg:attrPlainString]", element);
        assertXPathEquals("/b:root/@pkg:attrPlainString", "attrPlain", element);
    }
View Full Code Here


                w2.writeXsiNil();
                w2.close();
                return;
            }

            type.writeObject(obj, w2, context);
            w2.close();
        } catch (DatabindingException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

                    return;
                }
            }
            ElementWriter writer = new ElementWriter(output);
            MessageWriter w2 = writer.getElementWriter(part.getConcreteName());
            type.writeObject(obj, w2, context);
            w2.close();
        } catch (DatabindingException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

        Context messageContext = new Context(context);
        Element element = new Element("root", "b", "urn:Bean");
        new Document(element);
        XmlMappedAttributeBean bean = new XmlMappedAttributeBean();
        type.writeObject(bean, new JDOMWriter(element), messageContext);
        assertValid("/b:root[@attrXmlString]", element);
        assertXPathEquals("/b:root/@attrXmlString", "attrXml", element);
    }
   
    @Test
View Full Code Here

        Context messageContext = new Context(context);
        Element element = new Element("root", "b", "urn:Bean");
        new Document(element);
        XmlMappedAttributeBean bean = new XmlMappedAttributeBean();
        type.writeObject(bean, new JDOMWriter(element), messageContext);
        assertValid("/b:root[@pkg:attrXmlString]", element);
        assertXPathEquals("/b:root/@pkg:attrXmlString", "attrXml", element);
    }

View Full Code Here

                                                   + " for property " + name);
                }

                MessageWriter cwriter = writer.getAttributeWriter(name);

                type.writeObject(value, cwriter, context);

                cwriter.close();
            }
        }
       
View Full Code Here

        }
       
        if (inf.isExtension()) {
            Type t = getSuperType();
            if (t != null) {
                t.writeObject(object, writer, context);
            }
        }

        for (Iterator itr = inf.getElements(); itr.hasNext();) {
            QName name = (QName)itr.next();
View Full Code Here

        tm.register(type);

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

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

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

        assertTrue(value instanceof EnumBean);
View Full Code Here

            writer.writeXsiType(type.getSchemaType());
            boolean nextIsBeanType = type instanceof BeanType;
            if (nextIsBeanType) {
                ((BeanType)type).writeObjectFromObjectType(object, writer, context, true);
            } else {
                type.writeObject(object, writer, context);
            }
        }
    }

    public Type determineType(Context context, Class clazz) {
View Full Code Here

            if (type.isNillable() && type.isWriteOuter() && obj == null) {
                w2.writeXsiNil();
                return;
            }

            type.writeObject(obj, w2, context);
            w2.close();
        } catch (DatabindingException e) {
            throw new RuntimeException(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.