public abstract class AbstractVersionIdentifierFormatterNumber extends AbstractFormatter<VersionIdentifier>
Formatter for a numeric part of the
VersionIdentifier.ComposedVersionIdentifierFormatter| Modifier and Type | Field and Description |
|---|---|
private int |
padding
The padding for the number.
|
private String |
prefix
The static prefix.
|
private StringUtil |
stringUtil
The
StringUtil instance. |
| Constructor and Description |
|---|
AbstractVersionIdentifierFormatterNumber(StringUtil stringUtil,
String prefix,
int padding)
The constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
doFormat(VersionIdentifier value,
Appendable buffer) |
protected abstract Number |
getNumber(VersionIdentifier value)
This method gets the
Number to format. |
format, format, formatNullprivate final StringUtil stringUtil
StringUtil instance.private final String prefix
private final int padding
public AbstractVersionIdentifierFormatterNumber(StringUtil stringUtil, String prefix, int padding)
stringUtil - is the StringUtil instance.prefix - is the static prefix to append before the number. Will be omitted if the number is null.padding - is the padding (minimum number of digits) for the number to format. The default is 0.protected abstract Number getNumber(VersionIdentifier value)
Number to format.value - is the VersionIdentifier.Number to format.protected void doFormat(VersionIdentifier value, Appendable buffer) throws IOException
doFormat in class AbstractFormatter<VersionIdentifier>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.