public abstract class FormattableColumnTranslator extends java.lang.Object implements ColumnTranslator
Constructor and Description |
---|
FormattableColumnTranslator() |
FormattableColumnTranslator(java.lang.String format) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getFormat() |
void |
setFormat(java.lang.String s)
/** Set the format to be used to "format" the object.
|
protected java.lang.String |
toString(java.lang.Object d)
Format the object using
String.format(String, Object...) if there is a format to apply otherwise
String.valueOf(Object) . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
translate, translate
public FormattableColumnTranslator()
public FormattableColumnTranslator(java.lang.String format)
public java.lang.String getFormat()
protected java.lang.String toString(java.lang.Object d)
String.format(String, Object...)
if there is a format to apply otherwise
String.valueOf(Object)
.d
- the object to format.public void setFormat(java.lang.String s)
If non-null then this will be used to format the column value; it relies exclusively on Formatter
via
String.format(String, Object...)
to format it into something meaningful. Note that no validation is performed on the
output or format; as a result runtime exceptions may be thrown.
s
- the format to apply.Formatter