|
org.netbeans.modules.editor.lib/1 1.14.0 3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.netbeans.editor.TokenContext
public class TokenContext
Token context defines the environment in which only a limited set of tokens can be used. This set can be retrieved by calling the getTokenIDs() method. The context can contain other contexts which means that the context can possibly switch into one of its children contexts during lexing. The child context can also have other children that can work in the same way. In this way context-paths can be created. They describe the way how was the token lexically recognized. The context can be retrieved when the syntax-class is known using the get method.
Constructor Summary | |
---|---|
TokenContext(String namePrefix)
|
|
TokenContext(String namePrefix,
TokenContext[] children)
Construct new token-context. |
Method Summary | |
---|---|
protected void |
addDeclaredTokenIDs()
Add all static-final token-id fields declared in this token-context using Class.getDeclaredFields() call. |
protected void |
addTokenID(TokenID tokenID)
Add token-id to the set of token-ids that belong to this context. |
TokenContextPath[] |
getAllContextPaths()
Get all the context paths for this token-context including itself as the first one and all its children. |
TokenContext[] |
getChildren()
Get the children contexts of this context. |
TokenContextPath |
getContextPath()
Get the context path for this token-context. |
TokenContextPath |
getContextPath(TokenContextPath childPath)
Get the context path for this token-context that is derived from the path of one of the children. |
String |
getNamePrefix()
Get the prefix that this context adds to the name of its tokens. |
TokenCategory[] |
getTokenCategories()
Get the token-categories that belong to this token-context. |
TokenID[] |
getTokenIDs()
Get the token-ids that belong to this token-context. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TokenContext(String namePrefix)
public TokenContext(String namePrefix, TokenContext[] children)
namePrefix
- name that will prefix all the token-ids names.children
- child token contexts.Method Detail |
---|
public String getNamePrefix()
public TokenContext[] getChildren()
protected void addTokenID(TokenID tokenID)
protected void addDeclaredTokenIDs() throws IllegalAccessException, SecurityException
public TokenID[] getTokenIDs()
public TokenCategory[] getTokenCategories()
public TokenContextPath getContextPath()
public TokenContextPath getContextPath(TokenContextPath childPath)
public TokenContextPath[] getAllContextPaths()
|
org.netbeans.modules.editor.lib/1 1.14.0 3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |