public final class ShortStringFormatter extends Object implements DiffXFormatter
Constructor and Description |
---|
ShortStringFormatter()
Creates a new formatter on the standard output.
|
ShortStringFormatter(Writer w)
Creates a new formatter using the specified writer.
|
Modifier and Type | Method and Description |
---|---|
void |
delete(DiffXEvent e)
Writes the event as a short string preceded by '+'.
|
void |
format(DiffXEvent e)
Writes the event as a short string.
|
void |
insert(DiffXEvent e)
Writes the event as a short string preceded by '+'.
|
void |
setConfig(DiffXConfig config)
Ignored.
|
static String |
toShortString(DiffXEvent e)
Returns the short string for the given event.
|
public ShortStringFormatter() throws IOException
IOException
- should an I/O exception occurs.System.out
public ShortStringFormatter(Writer w) throws IOException
w
- The writer to use.IOException
- should an I/O exception occurs.public void format(DiffXEvent e) throws IOException, IllegalStateException
format
in interface DiffXFormatter
e
- The event to formatIOException
- Should an I/O exception occurs while formatting.IllegalStateException
- If the formatter is not in a state to run this method.public void insert(DiffXEvent e) throws IOException, IllegalStateException
insert
in interface DiffXFormatter
e
- The event to formatIOException
- Should an I/O exception occurs while formatting.IllegalStateException
- If the formatter is not in a state to run this method.public void delete(DiffXEvent e) throws IOException, IllegalStateException
delete
in interface DiffXFormatter
e
- The event to formatIOException
- Should an I/O exception occurs while formatting.IllegalStateException
- If the formatter is not in a state to run this method.public void setConfig(DiffXConfig config)
setConfig
in interface DiffXFormatter
config
- The configuration to use.public static String toShortString(DiffXEvent e)
e
- The event.Copyright © 2007-2019. All Rights Reserved.