Package org.exolab.castor.xml

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


        try {
            Marshaller marshaller =
                new Marshaller(new DefaultHandler()); //serializer.asDocumentHandler());
            marshaller.setMapping(getCastorMapping());
            marshaller.marshal(object);
        } catch(IOException io) {
            throw io;
        } catch (Exception e) {
            throw new IOException(e.getMessage());
        }
View Full Code Here


        Marshaller marshaller = new Marshaller(writer);

        marshaller.setMapping(this.mapping);

        marshaller.marshal(apps);
    }

    public PortletApplicationEntityListImpl load() throws Exception
    {
      final String METHOD_NAME = "load()";
View Full Code Here

            XMLSerializer serializer = new XMLSerializer(writer, of);
            try {
            Marshaller marshaller =
                new Marshaller(serializer.asDocumentHandler());
            marshaller.setMapping(mappingWebXml);
            marshaller.marshal(webApp);
            } catch (Exception e) {
                writer.close();
                e.printStackTrace(System.out);
                throw new Exception();
            }
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

        try {
            Marshaller marshaller =
                new Marshaller(new DefaultHandler()); //serializer.asDocumentHandler());
            marshaller.setMapping(getCastorMapping());
            marshaller.marshal(object);
        } catch(IOException io) {
            throw io;
        } catch (Exception e) {
            throw new IOException(e.getMessage());
        }
View Full Code Here

  public void storeObject(OutputStream stream, Map parameters, Object object) throws ConverterException {
        Writer writer = new OutputStreamWriter(stream);
    try {
      Marshaller marshaller = new Marshaller( writer );
      marshaller.setMapping((Mapping)this.mappings.get(parameters.get(parameters.get("profiletype"))));
      marshaller.marshal(object);
      writer.close();
    } catch (MappingException e) {
      throw new ConverterException("can't create Unmarshaller", e);
    } catch (Exception e) {
      throw new ConverterException(e.getMessage(), e);
View Full Code Here

  private String marhsall(TxnRequest order) throws IOException, MarshalException, ValidationException {
    StringWriter writer = new StringWriter();
      Marshaller marshaller = xmlContext.createMarshaller();
      marshaller.setNamespaceMapping("","ns1");
      marshaller.setWriter(writer);
      marshaller.marshal(order);
      return writer.toString();
  }
 
  private TxnResult unmarshall(String response) throws IOException, MarshalException, ValidationException {
      Unmarshaller unmarshaller = xmlContext.createUnmarshaller();
View Full Code Here

  private String marhsall(Order order) throws IOException, MarshalException, ValidationException {
    StringWriter writer = new StringWriter();
      Marshaller marshaller = xmlContext.createMarshaller();
      marshaller.setNamespaceMapping("","ns1");
      marshaller.setWriter(writer);
      marshaller.marshal(order);
      return writer.toString();
  }
 
  private Result unmarshall(String response) throws IOException, MarshalException, ValidationException {
      Unmarshaller unmarshaller = xmlContext.createUnmarshaller();
View Full Code Here

            // //TimeZone tz = TimeZone.getDefault();
            // //TimeZone.setDefault(UTC);
            try {
                Marshaller marshaller = new Marshaller();
                marshaller.setWriter(new OutputStreamWriter(bout, "UTF-8"));
                marshaller.marshal(gpx);
            } catch (Exception ex) {
                IOException ioex = new IOException("Error writing GPX.");
                ioex.initCause(ex);
                throw ioex;
            } finally {
View Full Code Here

      }
    for (ItemSimple i : itemSimple.getItemsUpSell()) {
      i.setItemSellable(' ');
      i.setPublished(' ');
    }
    marshaller.marshal(itemSimple);
    return writer.toString().replaceFirst("\n", "") + System.getProperty("line.separator");
  }

  public ItemSimple fromImport(String input) throws Exception {
    Unmarshaller unmarshaller = xmlContext.createUnmarshaller();
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.