Package org.exolab.castor.xml

Examples of org.exolab.castor.xml.XMLContext.createMarshaller()


   
    XMLContext context = new XMLContext();
    context.addMapping(mapping);
   
    StringWriter writer = new StringWriter();
      Marshaller marshaller = context.createMarshaller();
      marshaller.setWriter(writer);
      marshaller.marshal(urlSet);
      result = writer.toString();
     
      return result;
View Full Code Here


           
            file = new File(DEFAULT_OUTPUT);
            FileWriter writer = new FileWriter(file);

            xmlContext.setProperty(XMLProperties.USE_INDENTATION, true);
            Marshaller marshaller = xmlContext.createMarshaller();
            marshaller.setWriter(writer);
           
            marshaller.setRootElement("changelog");
            marshaller.setSuppressXSIType(true);
            marshaller.marshal(changelog);
View Full Code Here

       
        Mapping mapping = xmlContext.createMapping();
        mapping.loadMapping(getClass().getResource(MAPPING_FILE).toExternalForm());
       
        StringWriter out = new StringWriter();
        Marshaller marshaller = xmlContext.createMarshaller();
        marshaller.setWriter(out);
        marshaller.setMapping(mapping);
       
// Joachim 2007-09-04 before XMLContext was introduced it looked like:
//        Configuration config = LocalConfiguration.getInstance();
View Full Code Here

       
        Mapping mapping = xmlContext.createMapping();
        mapping.loadMapping(getClass().getResource(MAPPING_FILE).toExternalForm());
       
        StringWriter out = new StringWriter();
        Marshaller marshaller = xmlContext.createMarshaller();
        marshaller.setWriter(out);
        marshaller.setMapping(mapping);
       
// Joachim 2007-09-04 before XMLContext was introduced it looked like:
//        Configuration config = LocalConfiguration.getInstance();
View Full Code Here

        //1.1 Prepare file writer
        Writer writer = new FileWriter("mapped_article.xml");

        //1.2 Create a new Marshaller
        Marshaller marshaller = context.createMarshaller();
        marshaller.setWriter(writer);

        //1.3 Marshal "map" to xml
        marshaller.marshal(createArticle());
       
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.