|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.blackbear.flatworm.FileCreator
public class FileCreator
Used to create a flatfile. This class wraps the functionality that used to be in the main() of the examples. This way, the client knows less about the internal workings of FlatWorm.
Constructor Summary | |
---|---|
FileCreator(java.io.InputStream config,
java.io.OutputStream stream)
|
|
FileCreator(java.io.InputStream config,
java.lang.String file)
|
|
FileCreator(java.lang.String config,
java.io.OutputStream stream)
|
|
FileCreator(java.lang.String config,
java.lang.String file)
Constructor for FileCreator |
Method Summary | |
---|---|
void |
close()
Close the output file, since we are using buffered IO, this is very important. |
void |
open()
Open the newfile for writing |
void |
setBean(java.lang.String name,
java.lang.Object bean)
This is a convienence method that lets the writer know about your bean without having to pass a HashMap to write() |
void |
setRecordSeperator(java.lang.String recordSeperator)
Flatworm does not assume you want a newline between records, call this method to set your record delimiter. |
void |
write(java.lang.String recordName)
Write information to the output file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileCreator(java.lang.String config, java.lang.String file) throws FlatwormCreatorException
String
- full path to the FlatWorm XML configuration fileString
- full path to output file
FlatwormCreatorException
- - wraps FlatwormConfigurationValueException & FlatwormUnsetFieldValueException
(to reduce number of exceptions clients have to be aware of)public FileCreator(java.lang.String config, java.io.OutputStream stream) throws FlatwormCreatorException
FlatwormCreatorException
public FileCreator(java.io.InputStream config, java.lang.String file) throws FlatwormCreatorException
FlatwormCreatorException
public FileCreator(java.io.InputStream config, java.io.OutputStream stream) throws FlatwormCreatorException
FlatwormCreatorException
Method Detail |
---|
public void open() throws FlatwormCreatorException
java.io.IOException
- - if there is some sort of filesystem related problem
FlatwormCreatorException
public void setBean(java.lang.String name, java.lang.Object bean)
String
- name of bean as defined in your flatworm XML fileObject
- the beanpublic void setRecordSeperator(java.lang.String recordSeperator)
String
- what you want to seperate your records. Could be "\n"public void close() throws java.io.IOException
String
- what you want to seperate your records. Could be "\n"
java.io.IOException
- - If the file system chooses not to close your file for some unknown reasonpublic void write(java.lang.String recordName) throws java.io.IOException, FlatwormCreatorException
String
- recordname as defined in your flatworm XML file
java.io.IOException
- - If the file system has a problem with you writing information to the recently opened file.
FlatwormCreationException
- - wraps varius Exceptions so client doesn't have to handle too many
FlatwormCreatorException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |