Search in sources :

Example 71 with Persister

use of org.simpleframework.xml.core.Persister in project netxms by netxms.

the class WebPageConfig method createXml.

/**
 * @see org.netxms.ui.eclipse.dashboard.widgets.internal.DashboardElementConfig#createXml()
 */
@Override
public String createXml() throws Exception {
    Serializer serializer = new Persister();
    Writer writer = new StringWriter();
    serializer.write(this, writer);
    return writer.toString();
}
Also used : StringWriter(java.io.StringWriter) Persister(org.simpleframework.xml.core.Persister) StringWriter(java.io.StringWriter) Writer(java.io.Writer) Serializer(org.simpleframework.xml.Serializer)

Example 72 with Persister

use of org.simpleframework.xml.core.Persister in project netxms by netxms.

the class SnmpTrapMonitorConfig method createXml.

/**
 * @see org.netxms.ui.eclipse.dashboard.widgets.internal.DashboardElementConfig#createXml()
 */
@Override
public String createXml() throws Exception {
    Serializer serializer = new Persister();
    Writer writer = new StringWriter();
    serializer.write(this, writer);
    return writer.toString();
}
Also used : StringWriter(java.io.StringWriter) Persister(org.simpleframework.xml.core.Persister) StringWriter(java.io.StringWriter) Writer(java.io.Writer) Serializer(org.simpleframework.xml.Serializer)

Example 73 with Persister

use of org.simpleframework.xml.core.Persister in project netxms by netxms.

the class LinkConfig method createXml.

/**
 * Create XML from configuration.
 *
 * @return XML document
 * @throws Exception if the schema for the object is not valid
 */
public String createXml() throws Exception {
    Serializer serializer = new Persister();
    Writer writer = new StringWriter();
    serializer.write(this, writer);
    return writer.toString();
}
Also used : StringWriter(java.io.StringWriter) Persister(org.simpleframework.xml.core.Persister) StringWriter(java.io.StringWriter) Writer(java.io.Writer) Serializer(org.simpleframework.xml.Serializer)

Example 74 with Persister

use of org.simpleframework.xml.core.Persister in project netxms by netxms.

the class SensorRegistrationConfig method createXml.

/**
 * Create XML from configuration.
 *
 * @return XML document
 * @throws Exception if the schema for the object is not valid
 */
public String createXml() throws Exception {
    Serializer serializer = new Persister();
    Writer writer = new StringWriter();
    serializer.write(this, writer);
    return writer.toString();
}
Also used : StringWriter(java.io.StringWriter) Persister(org.simpleframework.xml.core.Persister) StringWriter(java.io.StringWriter) Writer(java.io.Writer) Serializer(org.simpleframework.xml.Serializer)

Example 75 with Persister

use of org.simpleframework.xml.core.Persister in project netxms by netxms.

the class SensorConfig method createXml.

/**
 * Create XML from configuration.
 *
 * @return XML document
 * @throws Exception if the schema for the object is not valid
 */
public String createXml() throws Exception {
    Serializer serializer = new Persister();
    Writer writer = new StringWriter();
    serializer.write(this, writer);
    return writer.toString();
}
Also used : StringWriter(java.io.StringWriter) Persister(org.simpleframework.xml.core.Persister) StringWriter(java.io.StringWriter) Writer(java.io.Writer) Serializer(org.simpleframework.xml.Serializer)

Aggregations

Persister (org.simpleframework.xml.core.Persister)177 Serializer (org.simpleframework.xml.Serializer)141 StringWriter (java.io.StringWriter)74 Writer (java.io.Writer)62 Registry (org.simpleframework.xml.convert.Registry)23 RegistryStrategy (org.simpleframework.xml.convert.RegistryStrategy)23 Strategy (org.simpleframework.xml.strategy.Strategy)23 AnnotationStrategy (org.simpleframework.xml.convert.AnnotationStrategy)20 File (java.io.File)18 Test (org.junit.Test)14 IOException (java.io.IOException)12 StorageException (org.syncany.plugins.transfer.StorageException)8 RegistryMatcher (org.simpleframework.xml.transform.RegistryMatcher)6 ConfigTO (org.syncany.config.to.ConfigTO)5 UnreliableLocalTransferSettings (org.syncany.plugins.unreliable_local.UnreliableLocalTransferSettings)5 ByteArrayOutputStream (java.io.ByteArrayOutputStream)4 FileOutputStream (java.io.FileOutputStream)4 DateFormat (java.text.DateFormat)4 SimpleDateFormat (java.text.SimpleDateFormat)4 ArrayList (java.util.ArrayList)4