Examples of createMarshaller()


Examples of com.caucho.jaxb.JAXBContextImpl.createMarshaller()

    Map<String,Object> properties = new HashMap<String,Object>();
    properties.put(JAXBContextImpl.TARGET_NAMESPACE, namespace);

    JAXBContextImpl jaxbContext =
      new JAXBContextImpl(jaxbClassArray, properties);
    Marshaller marshaller = jaxbContext.createMarshaller();
    Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();

    DirectSkeleton skel =
      new DirectSkeleton(type, api, jaxbContext, wsdlLocation, namespace, wsdl);
View Full Code Here

Examples of com.sun.jersey.api.json.JSONJAXBContext.createMarshaller()

     */
    public void _testXmlCdataAnnotation(final JSONConfiguration configuration) throws Exception {
        final JAXBContext jaxbContext = new JSONJAXBContext(ComplexXmlEventBean.class);

        // Marshal
        final Marshaller marshaller = jaxbContext.createMarshaller();
        final StringWriter writer = new StringWriter();

        final Object testInstance = ComplexXmlEventBean.createTestInstance();
        marshaller.marshal(testInstance,
                Stax2JsonFactory.createWriter(writer, configuration, ComplexXmlEventBean.class, jaxbContext));
View Full Code Here

Examples of javax.xml.bind.JAXBContext.createMarshaller()

    group.addTranslator(translator);
       
    // Now use JAXB and write the file.
    Class[] classes = { TranslatorMetaDataGroup.class };
    JAXBContext context = JAXBContext.newInstance(classes);
    Marshaller marshaller = context.createMarshaller();
    marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,new Boolean(true));

    FileWriter fw = null;
    try {
      fw = new FileWriter(dsXml);
View Full Code Here

Examples of javax.xml.bind.JAXBContext.createMarshaller()

     * @return an XML document of this PlanNode
     */
    public String toXml() {
      try {
        JAXBContext jc = JAXBContext.newInstance(new Class<?>[] {PlanNode.class});
      Marshaller marshaller = jc.createMarshaller();
      marshaller.setProperty("jaxb.formatted.output", Boolean.TRUE); //$NON-NLS-1$
      StringWriter writer = new StringWriter();
      marshaller.marshal(this, writer);
      return writer.toString();
      } catch (JAXBException e) {
View Full Code Here

Examples of javax.xml.bind.JAXBContext.createMarshaller()

    tm.setName("Oracle");
    tm.setDescription("desc");
    tm.addProperty("ExtensionTranslationClassName", "org.teiid.translator.jdbc.oracle.OracleSQLTranslator");
   
    JAXBContext jc = JAXBContext.newInstance(new Class<?>[] {TranslatorMetaDataGroup.class});
    Marshaller marshell = jc.createMarshaller();
    marshell.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,new Boolean(true));
   
    StringWriter sw = new StringWriter();
    marshell.marshal(group, sw);
       
View Full Code Here

Examples of javax.xml.bind.JAXBContext.createMarshaller()

    vdb.addDataPolicy(roleOne);
   
    SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
        Schema schema = schemaFactory.newSchema(VDBMetaData.class.getResource("/vdb-deployer.xsd"));      //$NON-NLS-1$
    JAXBContext jc = JAXBContext.newInstance(new Class<?>[] {VDBMetaData.class});
    Marshaller marshell = jc.createMarshaller();
    marshell.setSchema(schema);
    marshell.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,new Boolean(true));
   
    StringWriter sw = new StringWriter();
    marshell.marshal(vdb, sw);
View Full Code Here

Examples of javax.xml.bind.JAXBContext.createMarshaller()

    }
   
    private Marshaller getMarshaller() throws JAXBException {
        JAXBContext jaxbContext =
            VersionTransformer.getExposedJAXBContext(currentNamespaceURI);
        Marshaller marshaller = jaxbContext.createMarshaller();
        marshaller.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);
        return marshaller;
    }

    private void marshallFrom(String from, SOAPHeader header, Marshaller marshaller)
View Full Code Here

Examples of javax.xml.bind.JAXBContext.createMarshaller()

                header.addNamespaceDeclaration(Names.WSA_NAMESPACE_PREFIX,
                                               maps.getNamespaceURI());
                JAXBContext jaxbContext =
                    VersionTransformer.getExposedJAXBContext(
                                                     maps.getNamespaceURI());
                Marshaller marshaller = jaxbContext.createMarshaller();
                marshaller.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);
                transformer.encodeAsExposed(maps.getNamespaceURI(),
                                            maps.getMessageID(),
                                            Names.WSA_MESSAGEID_NAME,
                                            AttributedURIType.class,
View Full Code Here

Examples of javax.xml.bind.JAXBContext.createMarshaller()

                dest.addDocument(doc);
            } else if (Object.class.isAssignableFrom(obj.getClass())) {
               
                JAXBContext context = callback.getJAXBContext();
               
                Marshaller u = context.createMarshaller();
                u.setProperty(Marshaller.JAXB_ENCODING , "UTF-8");
                u.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
                u.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE)
               
                DOMResult domResult = new DOMResult();
View Full Code Here

Examples of javax.xml.bind.JAXBContext.createMarshaller()

   
    public static String toString(Object obj) throws JAXBException {
        String name = obj.getClass().getPackage().getName();
        JAXBContext context = JAXBContext.newInstance(name);
        JAXBElement<Object> el = new JAXBElement<Object>(new QName("test"), Object.class, obj);
        Marshaller m = context.createMarshaller();
        StringWriter writer = new StringWriter();
        m.marshal(el, writer);

        return writer.toString();      
    }
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.