|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.ibm.wbi.util.FileElementParser
A FileElementParser reads in the contents of a file and parses the
contents into elements and encapsulated data.
(i.e. close().
| Field Summary | |
protected boolean |
dirty
|
| Constructor Summary | |
FileElementParser()
Constructs a new file element parser. |
|
| Method Summary | |
void |
addElement(java.lang.String element,
java.lang.String data)
Add element to the file with the specified data. |
void |
close()
Close the file writing all the elements and their encapsulated data to the file. |
protected void |
finalize()
Just in case no ones closes the file and the garbage collector cleans this object up, then close the file first. |
void |
flush()
Flush the contents to the file. |
java.lang.String |
getElementData(java.lang.String element)
Get the encapsulated data associated with the specified element. |
java.util.Enumeration |
getElements()
Get an enumeration of all the elements that encapsulated data. |
static void |
main(java.lang.String[] args)
Test driver. |
void |
open(java.io.File file)
Open the file and extract all the elements and their encapsulated data. |
void |
open(java.lang.String file)
Open the file and extract all the elements and their encapsulated data. |
void |
removeElement(java.lang.String element)
Remove an element and it's encapsulated data. |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected boolean dirty
| Constructor Detail |
public FileElementParser()
| Method Detail |
public void open(java.lang.String file)
throws FileElementParserException,
java.io.IOException
file - The file to read from and write to when
close() is called.FileElementParserException - If any error occurs; see the
detailed message for more information.java.io.IOException - can be thrown for IO problems while closing the file
(for example, FileNotFoundException)
public void open(java.io.File file)
throws FileElementParserException,
java.io.IOException
file - The file to read from and write to when
close() is called.FileElementParserException - If any error occurs; see the
detailed message for more information.java.io.IOException - can be thrown for IO problems while closing the file
(for example, FileNotFoundException)
public void flush()
throws FileElementParserException,
java.io.IOException
FileElementParserException - If any error occurs; see the
detailed message for more information.java.io.IOException - can be thrown for IO problems while closing the file
(for example, FileNotFoundException)
public void close()
throws FileElementParserException,
java.io.IOException
FileElementParserException - If any error occurs; see the
detailed message for more information.java.io.IOException - can be thrown for IO problems while closing the file
(for example, FileNotFoundException)public java.util.Enumeration getElements()
public void addElement(java.lang.String element,
java.lang.String data)
element - The element to add to the file.data - The data encapsulated by the element.public java.lang.String getElementData(java.lang.String element)
element - The element.public void removeElement(java.lang.String element)
element - The element to remove.
protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwable - Nothing gets thrown.public static final void main(java.lang.String[] args)
args - Command line arguments.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||