|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectreader.HTMLReader
public abstract class HTMLReader
Defines the required methods for a class that Reads from a log file formatted in a certain way.
| Field Summary | |
|---|---|
protected FontState |
fs
Keeps track of what state the font is in. |
protected java.lang.String |
line
The next line of input of input from the file passed to loadFile(String). |
protected int |
lineNumber
The line number that line represents in the file. |
protected java.io.BufferedReader |
reader
The link to the file passed to loadFile(String). |
protected java.util.Vector<Session> |
sessions
The Sessions stored in this log file. |
| Constructor Summary | |
|---|---|
protected |
HTMLReader()
Creates a new FontState object. |
| Method Summary | |
|---|---|
protected void |
eat(java.lang.String tag,
java.lang.String errmsg)
Eats the passed tag from line. |
protected void |
eatBodyTag()
Eats the body tag and parses the parameters it contains. |
protected java.lang.String |
extractTag(java.lang.String line)
Takes the passed String object and updates the fs object
with the state of the font. |
protected void |
getNextLine()
Gets the next line of the file. |
boolean |
loadFile(java.lang.String filename)
This must be called at the top of the child class's loadFile(String)
method. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface reader.Reader |
|---|
iterator |
| Field Detail |
|---|
protected FontState fs
extractTag(String) with String objects containing
HTML tags at the front. Do not alter this variable directly unless
you really know what you are doing and you have a good reason.
protected java.util.Vector<Session> sessions
protected java.io.BufferedReader reader
loadFile(String). Should only
be read in loadFile(String). Will be null elsewhere.
protected java.lang.String line
loadFile(String).
Should only be referenced in loadFile(String).
protected int lineNumber
line represents in the file.
| Constructor Detail |
|---|
protected HTMLReader()
FontState object.
| Method Detail |
|---|
public boolean loadFile(java.lang.String filename)
throws java.io.IOException
loadFile(String)
method.
loadFile in interface Readerfilename - The name of the file to open and read from.
true if successful, false otherwise.
java.io.IOException - When an I/O error occurs.Reader.loadFile(String)
protected void getNextLine()
throws java.io.IOException
line and
lineNumber members.
java.io.IOException - if an I/O error occurs.
protected java.lang.String extractTag(java.lang.String line)
throws java.lang.IllegalArgumentException,
FileFormatException
String object and updates the fs object
with the state of the font. There must be a valid tag at the front of
the string. Recognized tags currently include:
<b> for bold text.
<em> for emphasized text.
<i> for italicized text.
<u> for underlined text.
<font> for font size, color, and face.
fs object.
line - The String with the tag at the front of it.
String minus the tag.
java.lang.IllegalArgumentException - if line does not have
an HTML tag at the front of it.
FileFormatException - if line is mal-formatted HTML.
protected void eat(java.lang.String tag,
java.lang.String errmsg)
throws java.io.IOException,
FileFormatException
line. The tag must be the
first thing to occur at the beginning of line (not including
whitespace) otherwise the method will return null.
tag - The tag to be eaten.errmsg - The error message to put in the FileFormatException if it
needs to be thrown.
java.io.IOException - if an I/O error occurs.
FileFormatException - If errmsg is not null
and the line did not start with the tag.
protected void eatBodyTag()
throws java.io.IOException,
FileFormatException
java.io.IOException - If an I/O error occurs.
FileFormatException - If the <body> tag is
formatted in an unexpected way.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||