public final class StringValueRegistry extends Object implements StringValueProvider
PENDING JW: for safety - better not implement but return a provider. We probably don't want readers to frickle around here?.
Modifier and Type | Field and Description |
---|---|
private HashMap<Integer,Class<?>> |
classPerColumn |
private static Logger |
LOG |
private Map<Class<?>,StringValue> |
perClass |
private HashMap<Integer,StringValue> |
perColumn |
Constructor and Description |
---|
StringValueRegistry() |
Modifier and Type | Method and Description |
---|---|
void |
clearColumnStringValues()
Removes all per-column mappings of StringValues.
|
private Class<?> |
getClass(int row,
int column)
Returns the Class of the column.
|
private Map<Integer,Class<?>> |
getColumnClassMap()
Returns the Map which stores the per-column Class, lazily
creates one if null.
|
private Map<Class<?>,StringValue> |
getPerClassMap()
Returns the Map which stores the per-class StringValues, lazily
creates one if null.
|
private Map<Integer,StringValue> |
getPerColumnMap()
Returns the Map which stores the per-column StringValues, lazily
creates one if null.
|
StringValue |
getStringValue(Class<?> clazz)
Returns the StringValue registered for the given class.
|
StringValue |
getStringValue(int row,
int column)
Returns a StringValue to use for conversion of the cell content at row and column.
|
private StringValue |
getStringValueByClass(Class<?> clazz) |
void |
setColumnClass(Class<?> clazz,
int column)
Sets the column class.
|
void |
setColumnClasses(Map<Integer,Class<?>> classPerColumn) |
void |
setStringValue(StringValue sv,
Class<?> clazz)
Sets the StringValue to use for the given class.
|
void |
setStringValue(StringValue sv,
int column)
Sets a StringValue to use for the given column.
|
private Map<Class<?>,StringValue> perClass
private HashMap<Integer,StringValue> perColumn
private HashMap<Integer,Class<?>> classPerColumn
public StringValueRegistry()
public StringValue getStringValue(int row, int column)
getStringValue
in interface StringValueProvider
row
- the row of the cell in model coordinatescolumn
- the column of the cell in model coordinatespublic void setStringValue(StringValue sv, int column)
sv
- the StringValue to use for the given column.column
- the column index in model coordinates.public void clearColumnStringValues()
public void setStringValue(StringValue sv, Class<?> clazz)
sv
- the StringValue to use for the given column.clazz
- the classpublic StringValue getStringValue(Class<?> clazz)
This is temporarily exposed for testing only - do not use, it will be removed very soon!
clazz
- the class to find the registered StringValue forpublic void setColumnClass(Class<?> clazz, int column)
clazz
- column
- index in model coordinatespublic void setColumnClasses(Map<Integer,Class<?>> classPerColumn)
classPerColumn
- private StringValue getStringValueByClass(Class<?> clazz)
clazz
- private Class<?> getClass(int row, int column)
row
- column
- private Map<Integer,Class<?>> getColumnClassMap()
private Map<Class<?>,StringValue> getPerClassMap()
private Map<Integer,StringValue> getPerColumnMap()
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses