Class FormattableColumnTranslator
- java.lang.Object
-
- com.adaptris.core.services.jdbc.types.FormattableColumnTranslator
-
- All Implemented Interfaces:
ColumnTranslator
- Direct Known Subclasses:
DoubleColumnTranslator
,FloatColumnTranslator
,IntegerColumnTranslator
,StringColumnTranslator
public abstract class FormattableColumnTranslator extends java.lang.Object implements ColumnTranslator
Abstract column Translator implementation for handling column types that might need to have formatting applied to it.
-
-
Constructor Summary
Constructors Constructor Description FormattableColumnTranslator()
FormattableColumnTranslator(java.lang.String format)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 usingString.format(String, Object...)
if there is a format to apply otherwiseString.valueOf(Object)
.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.adaptris.core.services.jdbc.types.ColumnTranslator
translate, translate
-
-
-
-
Method Detail
-
getFormat
public java.lang.String getFormat()
-
toString
protected java.lang.String toString(java.lang.Object d)
Format the object usingString.format(String, Object...)
if there is a format to apply otherwiseString.valueOf(Object)
.- Parameters:
d
- the object to format.
-
setFormat
public void setFormat(java.lang.String s)
/** Set the format to be used to "format" the object.If non-null then this will be used to format the column value; it relies exclusively on
Formatter
viaString.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.- Parameters:
s
- the format to apply.- See Also:
Formatter
-
-