Package com.topologi.diffx.format
Class MultiplexFormatter
java.lang.Object
com.topologi.diffx.format.MultiplexFormatter
- All Implemented Interfaces:
DiffXFormatter
A formatter which can relay the method calls to multiple formatters.
- Version:
- 11 December 2008
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<DiffXFormatter>the list of formatters to use. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new formatter without any underlying formatters.Creates a new formatter wrapping the specified formatter. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a formatter to multiplex.voiddelete(DiffXEvent e) Formats the specified deleted event.voidformat(DiffXEvent e) Formats the specified event.voidinsert(DiffXEvent e) Formats the specified inserted event.voidsetConfig(DiffXConfig config) Sets the configuration to use with this formatter.
-
Field Details
-
formatters
the list of formatters to use.
-
-
Constructor Details
-
MultiplexFormatter
public MultiplexFormatter()Creates a new formatter without any underlying formatters. -
MultiplexFormatter
Creates a new formatter wrapping the specified formatter.- Parameters:
f- The formatter to use.
-
-
Method Details
-
add
Adds a formatter to multiplex.- Parameters:
f- The Diff-X formatter to add.
-
format
Description copied from interface:DiffXFormatterFormats the specified event.- Specified by:
formatin interfaceDiffXFormatter- Parameters:
e- The event to format- Throws:
IOException- Should an I/O exception occurs while formatting.
-
insert
Description copied from interface:DiffXFormatterFormats the specified inserted event.- Specified by:
insertin interfaceDiffXFormatter- Parameters:
e- The event to format- Throws:
IOException- Should an I/O exception occurs while formatting.
-
delete
Description copied from interface:DiffXFormatterFormats 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
Description copied from interface:DiffXFormatterSets the configuration to use with this formatter.- Specified by:
setConfigin interfaceDiffXFormatter- Parameters:
config- The configuration to use.
-