V
- is the generic type of the actual value to format
.public class ComposedFormatter<V> extends AbstractFormatter<V>
Formatter
that is composed out of other Formatter
s. It implements the
divide and conquer strategy by delegating to a given sequence of sub-formatters
in a given order.
Each sub-formatter appends a particular part to the result according to his responsibility.Modifier and Type | Field and Description |
---|---|
private Formatter<V>[] |
subFormatters |
Constructor and Description |
---|
ComposedFormatter(Formatter<V>... subFormatters)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
doFormat(V value,
Appendable buffer) |
format, format, formatNull
private final Formatter<V>[] subFormatters
doFormat(Object, Appendable)
@SafeVarargs public ComposedFormatter(Formatter<V>... subFormatters)
subFormatters
- are the Formatter
s to delegate to in the given order.protected void doFormat(V value, Appendable buffer) throws IOException
doFormat
in class AbstractFormatter<V>
value
- is the value to format (not null
).buffer
- is the Appendable
to append
the formatted value to.IOException
- if caused by append
.AbstractFormatter.format(Object, Appendable)
Copyright © 2001–2016 mmm-Team. All rights reserved.