public class NameConverters extends Object
NameConverter
instance that performs custom conversions, for instance by doing
database lookups or using a specific name-to-structure algorithm.Modifier and Type | Method and Description |
---|---|
static void |
add(NameConverter converter,
int priority)
Add a name to structure converter.
|
static void |
addThreadLocal(NameConverter converter,
int priority)
Add a thread-local name to structure converter.
|
static boolean |
remove(NameConverter converter)
Remove the converter from the converter list.
|
public static void add(NameConverter converter, int priority)
converter
- the converter to be added.priority
- the priority of the converter:
When several converters are present, they are run one by one in decreasing order of priority
until one converter returns a structure, or all converters have been run.
This can also be used to specify if custom converters have priority over built-in ones, given the following priorities for built-in converters:
For instance, a custom converter with a positive priority will take precedence over built-in ones. A custom converter with a priority below -300 will only be run when all built-in conversions have failed to recognize the name.
public static void addThreadLocal(NameConverter converter, int priority)
converter
- the converter to be added.priority
- the priority of the converter:
When several converters are present, they are run one by one in decreasing order of priority
until one converter returns a structure, or all converters have been run.
This can also be used to specify if custom converters have priority over built-in ones, given the following priorities for built-in converters:
For instance, a custom converter with a positive priority will take precedence over built-in ones. A custom converter with a priority below -300 will only be run when all built-in conversions have failed to recognize the name.
public static boolean remove(NameConverter converter)
converter
- the converter to be removed