Package org.simpleframework.xml.stream

Examples of org.simpleframework.xml.stream.Format


        fileName));
    writeList(ser, fos, listElement, list);
  }
 
  private <T> void writeList(Serializer ser, OutputStream os, String listElement, List<T> list) throws Exception {
    Format format = new Format("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
    OutputNode doc = NodeBuilder.write(new OutputStreamWriter(os, "UTF-8"), format);
    OutputNode root = doc.getChild("root");
    root.setComment(BACKUP_COMMENT);
    OutputNode listNode = root.getChild(listElement);
View Full Code Here


        fileName));
    writeList(ser, fos, listElement, list);
  }
 
  private <T> void writeList(Serializer ser, OutputStream os, String listElement, List<T> list) throws Exception {
    Format format = new Format("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
    OutputNode doc = NodeBuilder.write(new OutputStreamWriter(os, "UTF-8"), format);
    OutputNode root = doc.getChild("root");
    root.setComment(BACKUP_COMMENT);
    OutputNode listNode = root.getChild(listElement);
View Full Code Here

        fileName));
    writeList(ser, fos, listElement, list);
  }
 
  private <T> void writeList(Serializer ser, OutputStream os, String listElement, List<T> list) throws Exception {
    Format format = new Format("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
    OutputNode doc = NodeBuilder.write(new OutputStreamWriter(os, "UTF-8"), format);
    OutputNode root = doc.getChild("root");
    root.setComment(BACKUP_COMMENT);
    OutputNode listNode = root.getChild(listElement);
View Full Code Here

    FileOutputStream fos = new FileOutputStream(new File(backup_dir, fileName));
    writeList(ser, fos, listElement, list);
  }
 
  private <T> void writeList(Serializer ser, OutputStream os, String listElement, List<T> list) throws Exception {
    Format format = new Format("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
    OutputNode doc = NodeBuilder.write(new OutputStreamWriter(os, "UTF-8"), format);
    OutputNode root = doc.getChild("root");
    root.setComment(BACKUP_COMMENT);
    OutputNode listNode = root.getChild(listElement);
View Full Code Here

    return board;
  }
 
  public static Serializer createSerializer() {
    Style style = new HyphenStyle();
    Format format = new Format(style);
    AnnotationStrategy strategy = new AnnotationStrategy();
    Serializer serializer = new Persister(strategy, format);
    return serializer;
  }
View Full Code Here

        try
        {
            final ProcessingComponentDocs components = new ProcessingComponentDocs(suite);
   
            final Format format = new Format(2,
                "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
   
            new Persister(format).write(components,
                new FileOutputStream(new File(output)), "UTF-8");
        }
View Full Code Here

        httpResponse.addDateHeader("Expires", expiresCalendar.getTimeInMillis());
    }

    private Format getPersisterFormat(RequestModel requestModel)
    {
        return new Format(2, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
            + "<?ext-stylesheet resource=\""
            + webappConfig.getContextRelativeSkinStylesheet(requestModel) + "\" ?>");
    }
View Full Code Here

        final Path saveLocation = FileDialogs.openSaveXML(pathHint);
        if (saveLocation != null)
        {
            try
            {
                final Persister persister = new Persister(new Format(2));
                persister.write(attributes, saveLocation.toFile());
            }
            catch (Exception e)
            {
                Utils.showError(new Status(IStatus.ERROR, WorkbenchCorePlugin.PLUGIN_ID,
View Full Code Here

    DataOutputStream plaintextOutputStream = new DataOutputStream(plaintextByteArrayOutputStream);
    plaintextOutputStream.writeInt(transferSettings.getType().getBytes().length);
    plaintextOutputStream.write(transferSettings.getType().getBytes());

    GZIPOutputStream plaintextGzipOutputStream = new GZIPOutputStream(plaintextOutputStream);
    new Persister(new Format(0)).write(transferSettings, plaintextGzipOutputStream);
    plaintextGzipOutputStream.close();

    return plaintextByteArrayOutputStream.toByteArray();
  }
View Full Code Here

TOP

Related Classes of org.simpleframework.xml.stream.Format

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.