public class SpecialTokenRegistry extends Object
Modifier and Type | Field and Description |
---|---|
private boolean |
frozen |
private static Logger |
log
The log of this
|
private static SpecialTokens |
nullSpecialTokens |
private Map<String,SpecialTokens> |
specialTokenMap
The current authorative special token lists, indexed on name.
|
Constructor and Description |
---|
SpecialTokenRegistry()
Creates an empty special token registry which
does not subscribe to any configuration
|
SpecialTokenRegistry(com.yahoo.vespa.configdefinition.SpecialtokensConfig config)
Create a special token registry from a configuration object.
|
SpecialTokenRegistry(String configId)
Create a special token registry which subscribes to the specialtokens
configuration.
|
Modifier and Type | Method and Description |
---|---|
private void |
addSpecialTokens(List<SpecialTokens> list) |
void |
addSpecialTokens(SpecialTokens specialTokens)
Adds a SpecialTokens instance to the registry.
|
private void |
build(com.yahoo.vespa.configdefinition.SpecialtokensConfig config) |
private void |
ensureNotFrozen() |
private void |
freeze() |
SpecialTokens |
getSpecialTokens(String name)
Returns the currently authorative list of special tokens for
a given name.
|
private static Logger log
private static final SpecialTokens nullSpecialTokens
private Map<String,SpecialTokens> specialTokenMap
private boolean frozen
public SpecialTokenRegistry()
public SpecialTokenRegistry(String configId)
public SpecialTokenRegistry(com.yahoo.vespa.configdefinition.SpecialtokensConfig config)
private void freeze()
private void build(com.yahoo.vespa.configdefinition.SpecialtokensConfig config)
public void addSpecialTokens(SpecialTokens specialTokens)
specialTokens
- the SpecialTokens object to addprivate void ensureNotFrozen()
private void addSpecialTokens(List<SpecialTokens> list)
public SpecialTokens getSpecialTokens(String name)
name
- the name of the special tokens to return
null, the empth string or the string "default" returns
the default onesCopyright © 2017. All rights reserved.