Package com.topologi.diffx.format
Class ShortStringFormatter
java.lang.Object
com.topologi.diffx.format.ShortStringFormatter
- All Implemented Interfaces:
DiffXFormatter
A simple formatter to write the short string version of the events.
- Version:
- 18 March 2005
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new formatter on the standard output.Creates a new formatter using the specified writer. -
Method Summary
Modifier and TypeMethodDescriptionvoiddelete(DiffXEvent e) Writes the event as a short string preceded by '+'.voidformat(DiffXEvent e) Writes the event as a short string.voidinsert(DiffXEvent e) Writes the event as a short string preceded by '+'.voidsetConfig(DiffXConfig config) Ignored.static StringReturns the short string for the given event.
-
Field Details
-
out
The output goes here.
-
-
Constructor Details
-
ShortStringFormatter
Creates a new formatter on the standard output.- Throws:
IOException- should an I/O exception occurs.- See Also:
-
ShortStringFormatter
Creates a new formatter using the specified writer.- Parameters:
w- The writer to use.- Throws:
IOException- should an I/O exception occurs.
-
-
Method Details
-
format
Writes the event as a short string. Formats the specified event.- Specified by:
formatin interfaceDiffXFormatter- Parameters:
e- The event to format- Throws:
IOException- Should an I/O exception occurs while formatting.IllegalStateException- If the formatter is not in a state to run this method.
-
insert
Writes the event as a short string preceded by '+'. Formats the specified inserted event.- Specified by:
insertin interfaceDiffXFormatter- Parameters:
e- The event to format- Throws:
IOException- Should an I/O exception occurs while formatting.IllegalStateException- If the formatter is not in a state to run this method.
-
delete
Writes the event as a short string preceded by '+'. Formats the specified deleted event.- Specified by:
deletein interfaceDiffXFormatter- Parameters:
e- The event to format- Throws:
IOException- Should an I/O exception occurs while formatting.IllegalStateException- If the formatter is not in a state to run this method.
-
setConfig
Ignored. Sets the configuration to use with this formatter.- Specified by:
setConfigin interfaceDiffXFormatter- Parameters:
config- The configuration to use.
-
toShortString
Returns the short string for the given event.- Parameters:
e- The event.- Returns:
- The short string for the given event.
-