|
|||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
Interface Summary | |
---|---|
ObjectTransformer | Interface that describes the Skaringa transformer. |
Class Summary | |
---|---|
ObjectTransformerFactory | Factory that produces concrete implementations of ObjectTransformer. |
PropertyKeys | This class provides string constants that can be used to set properties for ObjectTransformer. |
Exception Summary | |
---|---|
DeserializerException | Exception that is thrown in case of errors during deserialization. |
NoImplementationException | Exception that is thrown if the ObjectTransformerFactory isn't able to find an implementation. |
SerializerException | Exception that is thrown in case of errors during serialization. |
Main interface, factory and exceptions.
Person fred = new Person(); ObjectTransformer trans = ObjectTransformerFactory.getInstance().getImplementation(); FileOutputStream out = new FileOutputStream("fred.xml"); trans.serialize(fred, new StreamResult(out)); out.close();
FileInputStream in = new FileInputStream("fred.xml"); Person freddy = (Person) trans.deserialize(new StreamSource(in)); in.close();
out = new FileOutputStream("Person.xsd"); trans.writeXMLSchema(Person.class, new StreamResult(out)); out.close();
trans.setPostprocessorInstruction(new StreamSource( ClassLoader.getSystemResourceAsStream("Person2OrgMember.xsl"))); OrgMember fredTheMember = (OrgMember) trans.transform(fred);
Person fred = new Person(); ObjectTransformer trans = ObjectTransformerFactory.getInstance().getImplementation(); OutputStream out = new FileOutputStream("fred.js"); trans.serializeToJson(fred, out); out.close();
FileInputStream in = new FileInputStream("fred.js"); Person freddy = (Person) trans.deserializeFromJson(in, Person.class); in.close();
|
|||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |