1 31 32 package org.antlr.xjlib.appkit.document; 33 34 import java.beans.XMLDecoder ; 35 import java.beans.XMLEncoder ; 36 import java.io.*; 37 import java.util.Map ; 38 39 public class XJDataXML extends XJData { 40 41 public int dataType() { 42 return DATA_XML; 43 } 44 45 public void readData() throws IOException, ClassNotFoundException { 46 XMLDecoder d = new XMLDecoder (new BufferedInputStream(new FileInputStream(getFile()))); 47 dictionary = (Map <String ,Object >)d.readObject(); 48 customReadData(d); 49 d.close(); 50 } 51 52 public void writeData() throws IOException { 53 XMLEncoder e = new XMLEncoder (new BufferedOutputStream(new FileOutputStream(getFile()))); 54 e.writeObject(dictionary); 55 customWriteData(e); 56 e.close(); 57 } 58 59 public void customReadData(XMLDecoder d) { 60 61 } 62 63 public void customWriteData(XMLEncoder e) { 64 65 } 66 } 67 | Popular Tags |