Package org.exolab.castor.xml

Examples of org.exolab.castor.xml.Marshaller.marshal()


                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


        {
//            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

        {
            format.setEncoding(encoding);
            Serializer serializer = new XMLSerializer(writer, format);
            Marshaller marshaller = new Marshaller(serializer.asDocumentHandler());
            marshaller.setMapping(this.mapping);
            marshaller.marshal(portlets);
        }
    }

    /** Tests wether the passed argument is an URL string or a file name
     *  and returns the corresponding file object, using diskcache for
View Full Code Here

            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

            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

            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

    try {
      Marshaller marshaller = this.context.createMarshaller();
      marshaller.setValidation(false);
      marshaller.setProperty("org.exolab.castor.indent", "true");
      marshaller.setWriter(new FileWriter(name));
      marshaller.marshal(gwesm);
    } catch (Exception e) {
      throw new DAOException("Error saving data", e);
    }

  }
View Full Code Here

        // writer response
        StringWriter writer = new StringWriter();
//        PrintWriter writer = response.getWriter();
        Marshaller marshaller = new Marshaller(writer);
        try {
            marshaller.marshal(flexResponse);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        writer.close();
        String responseStr = writer.getBuffer().toString();
View Full Code Here

                LOG.debug("Pluto descriptor service implementation using JAXP: [" + USING_JAXP + "]");                       
            }
           
            castorConfig.getProperties().setProperty("org.exolab.castor.indent", "true");
            setCastorMarshallerOptions(marshaller, object);
            marshaller.marshal(object);
        } catch (IOException e) {
            LOG.error(e.getMessage(), e);
            throw e;
        } catch (Exception e) {
            LOG.error(e.getMessage(), e);
View Full Code Here

        try {
            Marshaller marshaller = new Marshaller(new DocumentHandlerAdapter(handler));
            if (mapping != null) {
                marshaller.setMapping(mapping);
            }
            marshaller.marshal(bean);
        }
        catch (ValidationException e) {
            throw new SAXException(e);
        }
        catch (MappingException 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.