org.objectweb.jac.aspects.export
Class Importer

java.lang.Object
  extended byorg.xml.sax.helpers.DefaultHandler
      extended byorg.objectweb.jac.aspects.export.Importer
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public class Importer
extends org.xml.sax.helpers.DefaultHandler
implements org.xml.sax.ContentHandler

See Also:
Exporter

Constructor Summary
Importer()
           
 
Method Summary
 void characters(char[] chars, int start, int length)
           
 void endDocument()
           
 void endElement(String uri, String localName, String qName)
           
 void ignorableWhitespace(char[] chars, int start, int length)
           
 void importObjects(File file)
          Imports objects from a file created by the exporter, using UTF-8 encoding.
 void importObjects(File file, String encoding)
          Imports objects from a file created by the exporter.
protected  Object readValue(String s)
           
 void startDocument()
           
 void startElement(String uri, String localName, String qName, org.xml.sax.Attributes attributes)
           
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endPrefixMapping, error, fatalError, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.xml.sax.ContentHandler
endPrefixMapping, processingInstruction, setDocumentLocator, skippedEntity, startPrefixMapping
 

Constructor Detail

Importer

public Importer()
Method Detail

importObjects

public void importObjects(File file)
                   throws IOException,
                          org.xml.sax.SAXException
Imports objects from a file created by the exporter, using UTF-8 encoding. All fields must have proper setters, or their values won't be properly restored regarding a persistence aspect.

Parameters:
file - the file to read the objects data from. It can be compressed.
Throws:
IOException
org.xml.sax.SAXException
See Also:
importObjects(File,String)

importObjects

public void importObjects(File file,
                          String encoding)
                   throws IOException,
                          org.xml.sax.SAXException
Imports objects from a file created by the exporter. All fields must have proper setters, or their values won't be properly restored regarding a persistence aspect.

Parameters:
file - the file to read the objects data from. It can be compressed.
encoding - charset encoding of the file
Throws:
IOException
org.xml.sax.SAXException
See Also:
importObjects(File)

startDocument

public void startDocument()
Specified by:
startDocument in interface org.xml.sax.ContentHandler

endDocument

public void endDocument()
Specified by:
endDocument in interface org.xml.sax.ContentHandler

startElement

public void startElement(String uri,
                         String localName,
                         String qName,
                         org.xml.sax.Attributes attributes)
Specified by:
startElement in interface org.xml.sax.ContentHandler

endElement

public void endElement(String uri,
                       String localName,
                       String qName)
Specified by:
endElement in interface org.xml.sax.ContentHandler

characters

public void characters(char[] chars,
                       int start,
                       int length)
Specified by:
characters in interface org.xml.sax.ContentHandler

ignorableWhitespace

public void ignorableWhitespace(char[] chars,
                                int start,
                                int length)
Specified by:
ignorableWhitespace in interface org.xml.sax.ContentHandler

readValue

protected Object readValue(String s)
                    throws IOException
Throws:
IOException