Package org.exolab.castor.xml

Examples of org.exolab.castor.xml.Marshaller


        StringWriter writer = new StringWriter();
        try
        {
//            portlets.marshal(writer);

            Marshaller marshaller = new Marshaller(writer);
            marshaller.setMapping(mapping);
            marshaller.marshal(portlets);
           
            if (logger.isDebugEnabled())
              logger.debug("Portlets: " + writer.toString());

            /**** Platform's default character encoding will be used ****/
 
View Full Code Here


            // create the serializer output format
            OutputFormat format = new OutputFormat();
            format.setIndenting(true);
            format.setIndent(4);
            Serializer serializer = new XMLSerializer(writer,format);
            Marshaller marshaller = new Marshaller(serializer.asDocumentHandler());
            marshaller.setMapping(this.loadMapping());
            marshaller.marshal(doc.getPortlets());

            success = true;
        }
        catch (MarshalException e)
        {
View Full Code Here

            // create the serializer output format
            OutputFormat format = new OutputFormat();
            format.setIndenting(true);
            format.setIndent(4);
            Serializer serializer = new XMLSerializer(writer,format);
            Marshaller marshaller = new Marshaller(serializer.asDocumentHandler());
            marshaller.setMapping(this.loadMapping());
            marshaller.marshal(doc.getPortlets());

            success = true;
        }
        catch (MarshalException e)
        {
View Full Code Here

        StringWriter writer = new StringWriter();
        try
        {
//            portlets.marshal(writer);

            Marshaller marshaller = new Marshaller(writer);
            marshaller.setMapping(mapping);
            marshaller.marshal(portlets);

            logger.debug("Portlets: " + writer.toString());

            /**** Platform's default character encoding will be used ****/
            return writer.toString().getBytes();
View Full Code Here

                writer = new FileWriter(f);

                System.out.println("-----------------------------------------------------------------");
                Serializer serializer = new XMLSerializer(writer, format);
                Marshaller marshaller = new Marshaller(serializer.asDocumentHandler());
                marshaller.setMapping(mapping);
                marshaller.marshal(rootset);
                System.out.println("-----------------------------------------------------------------");
                System.out.println("done");

            }
            catch (Exception e)
View Full Code Here

            try
            {
                writer = new OutputStreamWriter(new FileOutputStream(file), encoding);
                format.setEncoding(encoding);
                Serializer serializer = new XMLSerializer(writer, format);
                Marshaller marshaller = new Marshaller(serializer.asDocumentHandler());
                marshaller.setMapping(this.mapping);
                marshaller.marshal(fragment);
            }
            catch (Throwable t)
            {
                logger.error("RegistryService: Could not marshal: " + file, t);
            }
View Full Code Here

        if (portlets != null)
        {
            format.setEncoding(encoding);
            Serializer serializer = new XMLSerializer(writer, format);
            Marshaller marshaller = new Marshaller(serializer.asDocumentHandler());
            marshaller.setMapping(this.mapping);
            marshaller.marshal(portlets);
        }
    }
View Full Code Here

                writer = new FileWriter(f);

                System.out.println("-----------------------------------------------------------------");
                Serializer serializer = new XMLSerializer(writer, format);
                Marshaller marshaller = new Marshaller(serializer.asDocumentHandler());
                marshaller.setMapping(mapping);
                marshaller.marshal(rootset);
                System.out.println("-----------------------------------------------------------------");
                System.out.println("done");

            }
            catch (Exception e)
View Full Code Here

            try
            {
                writer = new OutputStreamWriter(new FileOutputStream(file), encoding);
                format.setEncoding(encoding);
                Serializer serializer = new XMLSerializer(writer, format);
                Marshaller marshaller = new Marshaller(serializer.asDocumentHandler());
                marshaller.setMapping(this.mapping);
                marshaller.marshal(fragment);
            }
            catch (Throwable t)
            {
                Log.error("RegistryService: Could not marshal: " + file, t);
            }
View Full Code Here

        StringWriter writer = new StringWriter();
        try
        {
//            portlets.marshal(writer);

            Marshaller marshaller = new Marshaller(writer);
            marshaller.setMapping(mapping);
            marshaller.marshal(portlets);

            Log.debug("Portlets: " + writer.toString());

            /**** Platform's default character encoding will be used ****/
            return writer.toString().getBytes();
View Full Code Here

TOP

Related Classes of org.exolab.castor.xml.Marshaller

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.