public final class InputAttributes extends Object
InputAttributes attrs = new InputAttributes(); attrs.setValue(JavaTokenId.language(), "version", "1.3", true); TokenHierarchy.create("assert", false, JavaTokenId.language(), null, attrs);
The properties are attached to a concrete language path only
or they may be applied globally to all of the occurrences
of the given path as a sub-path of the target path.
See the "global" argument of
InputAttributes.setValue(Language,Object,Object,boolean)
.
This class may safely be operated by multiple threads.
Constructor and Description |
---|
InputAttributes() |
Modifier and Type | Method and Description |
---|---|
Object |
getValue(LanguagePath languagePath,
Object attributeKey)
Get value for the given key for the particular language path.
|
void |
setValue(Language<?> language,
Object attributeKey,
Object attributeValue,
boolean global)
Assign a new value to a property for the language path constructed
from the given language.
|
void |
setValue(LanguagePath languagePath,
Object attributeKey,
Object attributeValue,
boolean global)
Assign a new value to a property for the given language path.
|
public Object getValue(LanguagePath languagePath, Object attributeKey)
languagePath
- non-null language path.attributeKey
- non-null key of the attribute.public void setValue(Language<?> language, Object attributeKey, Object attributeValue, boolean global)
public void setValue(LanguagePath languagePath, Object attributeKey, Object attributeValue, boolean global)
languagePath
- non-null language path.attributeKey
- non-null key of the attribute.attributeValue
- value of the key for the given language path.global
- if set to true then the value will be used not only for the given
language path but also as a default value (if the value is not overwritten explicitly)
for all the cases where the given path is embedded into the target language path.
attrs.setValue(LanguagePath.get(JavaTokenId.language()), "version", Integer.valueOf(5), true);sets the version 5 (it means java 1.5) to all the java code snipets regardless of where they are embedded in the token hierarchy.