public class ColumnFormatter extends Object
EvalConfig
can be used to alter how this utility formats
values. Note, formatted values may be suitable for display only
(i.e. a formatted value may not be accepted as an input value to a Table
add/update method).Constructor and Description |
---|
ColumnFormatter(Column col) |
Modifier and Type | Method and Description |
---|---|
String |
format(Object val)
Formats the given value according to the format currently defined for the
underlying Column.
|
String |
getFormatString()
Returns the currently loaded "Format" property for this formatter, may be
null . |
String |
getRowValue(Map<String,?> rowMap)
Convenience method for retrieving the appropriate Column value from the
given row map and formatting it.
|
String |
getRowValue(Object[] rowArray)
Convenience method for retrieving the appropriate Column value from the
given row array and formatting it.
|
void |
reload()
If the properties for the underlying Column have been modified directly
(or the EvalConfig for the underlying Database has been modified), this
method may be called to reload the format for the underlying Column.
|
void |
setFormatString(String fmtStr)
Sets the given format string as the "Format" property for the underlying
Column and reloads this formatter.
|
public ColumnFormatter(Column col) throws IOException
IOException
public String getFormatString()
null
.public void setFormatString(String fmtStr) throws IOException
fmtStr
- the new format string. may be null
, in which case
the "Format" property is removed from the underlying ColumnIOException
public String format(Object val)
val
- a valid input value for the DataType of the underlying Column
(i.e. a value which could be passed to a Table add/update
method for this Column). may be null
null
public String getRowValue(Object[] rowArray)
null
public String getRowValue(Map<String,?> rowMap)
null
public final void reload() throws IOException
IOException
Copyright © 2005–2024 OpenHMS. All rights reserved.