How to Serialize Objects with Skaringa

1) Create the file:

import com.skaringa.javaxml.ObjectTransformer;
import com.skaringa.javaxml.ObjectTransformerFactory;


import javax.xml.transform.Result;

import static java.lang.System.out;

public final class SkaringaSample {

  public static void main(final String[] args) throws Exception {
    final ObjectTransformerFactory factory = ObjectTransformerFactory.getInstance();

    final ObjectTransformer transformer = factory.getImplementation();

    transformer.serialize("Hello World", new StreamResult(new File("Sample.xml")));


2) Compile the file.

3) Launch the SkaringaSample class.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s