public abstract class AbstractConsoleSerializer extends Object implements ConsoleSerializer
| Modifier and Type | Field and Description |
|---|---|
protected List<String> |
lines
The list of lines.
|
protected BufferedWriter |
writer
The associated writer.
|
| Constructor and Description |
|---|
AbstractConsoleSerializer() |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clear the content of the serializer.
|
protected boolean |
createWriter(File file)
Creates a new writer.
|
void |
serialize(File file)
Called when the serializer is serialized.
|
protected void |
writeFooter()
Write the footer.
|
protected void |
writeHeader()
Write the header.
|
protected abstract void |
writeOneLine(String line)
Write one line.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddNewLine, addTextprotected BufferedWriter writer
public void serialize(File file) throws IOException
serialize in interface ConsoleSerializerfile - the fileIOExceptionprotected abstract void writeOneLine(String line) throws IOException
line - the lineIOExceptionprotected void writeHeader()
throws IOException
IOExceptionprotected void writeFooter()
throws IOException
IOExceptionpublic void clear()
clear in interface ConsoleSerializerprotected boolean createWriter(File file)
file - the file to write