java.lang.Object
com.intellij.psi.tree.IElementType
- 直接已知子类:
ILazyParseableElementType,TokenWrapper
Interface for token types returned from lexical analysis and for types
of nodes in the AST tree. All used element types are added to a registry which
can be enumerated or accessed by index.
- 另请参阅:
-
嵌套类概要
嵌套类 -
字段概要
字段修饰符和类型字段说明static final IElementType[]static final shortstatic final IElementType.PredicateDefault enumeration predicate which matches all token types. -
构造器概要
构造器限定符构造器说明IElementType(@NonNls @NotNull String debugName, @Nullable Language language) Creates and registers a new element type for the specified language.protectedIElementType(@NonNls @NotNull String debugName, @Nullable Language language, boolean register) Allows to construct element types for some temporary purposes without registering them. -
方法概要
修饰符和类型方法说明static IElementType @NotNull []enumerate(@NotNull IElementType.Predicate p) Enumerates all registered token types which match the specified predicate.static IElementTypefind(short idx) Returns the element type registered at the specified index.final shortgetIndex()Returns the index of the element type in the table of all registered element types.@NotNull LanguageReturns the language associated with the element type.inthashCode()booleanControls whitespace balancing behavior of PsiBuilder.toString()static voidunregisterElementTypes(@NotNull Language language) static voidunregisterElementTypes(@NotNull ClassLoader loader)
-
字段详细资料
-
EMPTY_ARRAY
-
TRUE
Default enumeration predicate which matches all token types.- 另请参阅:
-
FIRST_TOKEN_INDEX
public static final short FIRST_TOKEN_INDEX- 另请参阅:
-
-
构造器详细资料
-
IElementType
public IElementType(@NonNls @NotNull @NonNls @NotNull String debugName, @Nullable @Nullable Language language) Creates and registers a new element type for the specified language.- 参数:
debugName- the name of the element type, used for debugging purposes.language- the language with which the element type is associated.
-
IElementType
protected IElementType(@NonNls @NotNull @NonNls @NotNull String debugName, @Nullable @Nullable Language language, boolean register) Allows to construct element types for some temporary purposes without registering them. This is not default behavior and not recommended. A lot of other functionality (e.g.TokenSet) won't work with such element types. Please useIElementType(String, Language)unless you know what you're doing.
-
-
方法详细资料
-
unregisterElementTypes
-
unregisterElementTypes
-
getLanguage
Returns the language associated with the element type.- 返回:
- the associated language.
-
getIndex
public final short getIndex()Returns the index of the element type in the table of all registered element types.- 返回:
- the element type index.
-
hashCode
public int hashCode() -
toString
-
isLeftBound
public boolean isLeftBound()Controls whitespace balancing behavior of PsiBuilder.By default, empty composite elements (containing no children) are bounded to the right (previous) neighbour, forming following tree:
[previous_element] [whitespace] [empty_element] <empty> [next_element]Left-bound elements are bounded to the left (next) neighbour instead:
[previous_element] [empty_element] <empty> [whitespace] [next_element]See fleet.com.intellij.lang.impl.PsiBuilderImpl.prepareLightTree() for details.
- 返回:
- true if empty elements of this type should be bound to the left.
-
find
Returns the element type registered at the specified index.- 参数:
idx- the index for which the element type should be returned.- 返回:
- the element type at the specified index.
- 抛出:
IndexOutOfBoundsException- if the index is out of registered elements' range.
-
enumerate
Enumerates all registered token types which match the specified predicate.- 参数:
p- the predicate which should be matched by the element types.- 返回:
- the array of matching element types.
-