public class ChangeTable
extends java.lang.Object
A mapping between keys and actions to turn old values into new values.
Modifier and Type | Class and Description |
---|---|
static class |
ChangeTable.ChainedChanger
An implementation of Changer that applies a list of Changer instances to
the value in turn.
|
static interface |
ChangeTable.Changer
Callback used to produce a new value from an old one.
|
static interface |
ChangeTable.Splitter
Callback used to produce a list of values from a single old one.
|
Modifier and Type | Field and Description |
---|---|
static ChangeTable.Changer |
STRING_TO_INT |
Constructor and Description |
---|
ChangeTable() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
change(java.lang.Object tag,
java.lang.Object value) |
ChangeTable.Changer |
getChanger(java.lang.Object tag)
Get the Changer currently registered to handle a tag.
|
ChangeTable.Splitter |
getSplitter(java.lang.Object tag)
Get the Splitter currently registered to handle a tag.
|
void |
setChanger(java.lang.Object tag,
ChangeTable.Changer changer)
Set the Changer to be used for all values of a particular tag.
|
void |
setSplitter(java.lang.Object tag,
ChangeTable.Splitter splitter)
Set the Splitter to be used for all values of a particular tag.
|
public static final ChangeTable.Changer STRING_TO_INT
public void setChanger(java.lang.Object tag, ChangeTable.Changer changer)
tag
- the tag Object which will have all values changedchanger
- the Changer used to change the valuespublic void setSplitter(java.lang.Object tag, ChangeTable.Splitter splitter)
tag
- the tag Object which will have all values splitsplitter
- the Splitter used to split the valuespublic ChangeTable.Changer getChanger(java.lang.Object tag)
tag
- the tag Object for which values would be changedpublic ChangeTable.Splitter getSplitter(java.lang.Object tag)
tag
- the tag Object for which values would be splitpublic java.lang.Object change(java.lang.Object tag, java.lang.Object value) throws ParserException
ParserException