Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static final long serialVersionUID = 1L;
- JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
- // unmarshal from foo.xml
- Unmarshaller u = jc.createUnmarshaller();
- FooObject fooObj = (FooObject)u.unmarshal( new File( "foo.xml" ) );
- // marshal to System.out
- Marshaller m = jc.createMarshaller();
- m.marshal( fooObj, System.out );
- Serializer serializer = new Persister();
- MyObject object = serializer.read(MyObject.class, new File("file.xml));
- serializer.write(myInstance, new File("file.xml"));
Add Comment
Please, Sign In to add comment