com.mtp.pounder
Class PounderReader

java.lang.Object
  |
  +--com.mtp.pounder.PounderReader
All Implemented Interfaces:
PounderConstants

public class PounderReader
extends Object
implements PounderConstants

Reads data necessary for a Pounding from an InputStream.

Author:
Matthew Pekar

Nested Class Summary
static class PounderReader.PounderData
          Little utility class for passing around retrieved data.
 
Field Summary
 
Fields inherited from interface com.mtp.pounder.PounderConstants
FILE_EXTENSION, FILE_FORMAT_VERSION, VERSION
 
Constructor Summary
PounderReader()
          Default constructor.
 
Method Summary
protected  void checkVersion(Element root)
          Make sure we are reading a supported version.
protected  void parseComment(PounderReader.PounderData data, Element e)
          Parse the comment and add it to the data.
 PounderReader.PounderData read(File f)
          Returns data read from given File.
 PounderReader.PounderData read(InputStream in)
          Returns data read from given InputStream.
 PounderReader.PounderData read(URL url)
          Returns data read from given URL.
 PounderModel readModel(File f)
          Creates a FileInputStream and calls read() on it.
 PounderModel readModel(InputStream in)
          Reads PounderModel from XML data on given InputStream.
 void readToModel(PounderModel pm, File f)
          Read data from given File and place it in given PounderModel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PounderReader

public PounderReader()
Default constructor.

Method Detail

readToModel

public void readToModel(PounderModel pm,
                        File f)
                 throws Exception
Read data from given File and place it in given PounderModel.

Exception

readModel

public PounderModel readModel(File f)
                       throws Exception
Creates a FileInputStream and calls read() on it.

Exception

readModel

public PounderModel readModel(InputStream in)
                       throws Exception
Reads PounderModel from XML data on given InputStream.

Exception

read

public PounderReader.PounderData read(File f)
                               throws Exception
Returns data read from given File.

Exception

read

public PounderReader.PounderData read(URL url)
                               throws Exception
Returns data read from given URL.

Exception

checkVersion

protected void checkVersion(Element root)
                     throws InvalidVersionException
Make sure we are reading a supported version.

InvalidVersionException

parseComment

protected void parseComment(PounderReader.PounderData data,
                            Element e)
Parse the comment and add it to the data.


read

public PounderReader.PounderData read(InputStream in)
                               throws Exception
Returns data read from given InputStream.

Exception


Copyright © 2002 Matthew Pekar. All Rights Reserved.