public abstract class ASTDelegatePsiElement extends PsiElementBase
Iconable.IconFlags, Iconable.LastComputedIconFLAGS_LOCKED, ICON_PLACEHOLDEREMPTY_NAVIGATABLE_ELEMENT_ARRAYARRAY_FACTORY, EMPTY_ARRAYICON_FLAG_IGNORE_MASK, ICON_FLAG_OPEN, ICON_FLAG_READ_STATUS, ICON_FLAG_VISIBILITYEMPTY_NAVIGATION_ITEM_ARRAY| Constructor and Description |
|---|
ASTDelegatePsiElement() |
| Modifier and Type | Method and Description |
|---|---|
PsiElement |
add(PsiElement element)
Adds a child to this PSI element.
|
PsiElement |
addAfter(PsiElement element,
PsiElement anchor)
Adds a child to this PSI element, after the specified anchor element.
|
PsiElement |
addBefore(PsiElement element,
PsiElement anchor)
Adds a child to this PSI element, before the specified anchor element.
|
ASTNode |
addInternal(ASTNode first,
ASTNode last,
ASTNode anchor,
java.lang.Boolean before) |
PsiElement |
addRange(PsiElement first,
PsiElement last)
Adds a range of elements as children to this PSI element.
|
PsiElement |
addRangeAfter(PsiElement first,
PsiElement last,
PsiElement anchor)
Adds a range of elements as children to this PSI element, after the specified anchor element.
|
PsiElement |
addRangeBefore(PsiElement first,
PsiElement last,
PsiElement anchor)
Adds a range of elements as children to this PSI element, before the specified anchor element.
|
void |
checkAdd(PsiElement element)
Checks if it is possible to add the specified element as a child to this element,
and throws an exception if the add is not possible.
|
void |
checkDelete()
Checks if it is possible to delete the specified element from the tree,
and throws an exception if the add is not possible.
|
PsiElement |
copy()
Creates a copy of the file containing the PSI element and returns the corresponding
element in the created copy.
|
void |
delete()
Deletes this PSI element from the tree.
|
void |
deleteChildInternal(ASTNode child) |
void |
deleteChildRange(PsiElement first,
PsiElement last)
Deletes a range of children of this PSI element from the tree.
|
protected PsiElement |
findChildByFilter(TokenSet tokenSet) |
protected <T extends PsiElement> |
findChildByType(IElementType type) |
protected <T extends PsiElement> |
findChildByType(TokenSet type) |
protected <T extends PsiElement> |
findChildrenByType(IElementType elementType) |
protected <T extends PsiElement> |
findChildrenByType(IElementType elementType,
java.lang.Class<T> arrayClass) |
protected <T extends PsiElement> |
findChildrenByType(TokenSet elementType) |
protected <T extends PsiElement> |
findChildrenByType(TokenSet elementType,
java.lang.Class<T> arrayClass) |
PsiElement |
findElementAt(int offset)
Finds a leaf PSI element at the specified offset from the start of the text range of this node.
|
protected <T extends PsiElement> |
findLastChildByType(IElementType type) |
protected <T extends PsiElement> |
findNotNullChildByType(IElementType type) |
protected <T extends PsiElement> |
findNotNullChildByType(TokenSet type) |
PsiElement [] |
getChildren()
Returns the array of children for the PSI element.
|
PsiFile |
getContainingFile()
Returns the file containing the PSI element.
|
<T> T |
getCopyableUserData(Key<T> key)
Returns a copyable user data object attached to this element.
|
PsiElement |
getFirstChild()
Returns the first child of the PSI element.
|
Language |
getLanguage()
Returns the language of the PSI element.
|
PsiElement |
getLastChild()
Returns the last child of the PSI element.
|
PsiManagerEx |
getManager()
Returns the PSI manager for the project to which the PSI element belongs.
|
PsiElement |
getNextSibling()
Returns the next sibling of the PSI element.
|
abstract ASTNode |
getNode()
Returns the AST node corresponding to the element.
|
PsiElement |
getPrevSibling()
Returns the previous sibling of the PSI element.
|
int |
getStartOffsetInParent()
Returns the text offset of the PSI element relative to its parent.
|
java.lang.String |
getText()
Returns the text of the PSI element.
|
int |
getTextLength()
Returns the length of text of the PSI element.
|
int |
getTextOffset()
Returns the offset in the file to which the caret should be placed
when performing the navigation to the element.
|
TextRange |
getTextRange()
Returns the text range in the document occupied by the PSI element.
|
<T> void |
putCopyableUserData(Key<T> key,
T value)
Attaches a copyable user data object to this element.
|
PsiElement |
replace(PsiElement newElement)
Replaces this PSI element (along with all its children) with another element
(along with the children).
|
void |
replaceChildInternal(PsiElement child,
TreeElement newElement) |
void |
subtreeChanged() |
boolean |
textContains(char c)
Checks if the text of this element contains the specified character.
|
boolean |
textMatches(java.lang.CharSequence text)
Checks if the text of this PSI element is equal to the specified character sequence.
|
char [] |
textToCharArray()
Returns the text of the PSI element as a character array.
|
accept, acceptChildren, canNavigate, canNavigateToSource, findChildByClass, findChildrenByClass, findNotNullChildByClass, findReferenceAt, getContext, getName, getNavigationElement, getOriginalElement, getPresentation, getProject, getReference, getReferences, getResolveScope, getUseScope, isEquivalentTo, isPhysical, isValid, isWritable, navigate, notNullChild, processDeclarations, textMatchesbuildRowIcon, computeBaseIcon, createLayeredIcon, getAdjustedBaseIcon, getBaseIcon, getElementIcon, getIcon, iconWithVisibilityIfNeeded, isNativeFileType, isVisibilitySupported, overlayIcons, registerIconLayer, transformFlagschangeUserMap, clearUserData, clone, copyCopyableDataTo, copyUserDataTo, getUserData, getUserDataString, getUserMap, isUserDataEmpty, putUserData, putUserDataIfAbsent, replace, setUserMapequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetOwnReferences, getParent, getTextRangeInParent, toStringgetUserData, putUserDatapublic PsiFile getContainingFile()
PsiElementgetContainingFile in interface PsiElementgetContainingFile in class PsiElementBasepublic PsiManagerEx getManager()
PsiElementgetManager in interface PsiElementgetManager in class PsiElementBasepublic PsiElement [] getChildren()
PsiElementpublic PsiElement getFirstChild()
PsiElementgetFirstChild in interface PsiElementgetFirstChild in class PsiElementBasepublic PsiElement getLastChild()
PsiElementgetLastChild in interface PsiElementgetLastChild in class PsiElementBasepublic PsiElement getNextSibling()
PsiElementgetNextSibling in interface PsiElementgetNextSibling in class PsiElementBasepublic PsiElement getPrevSibling()
PsiElementgetPrevSibling in interface PsiElementgetPrevSibling in class PsiElementBasepublic TextRange getTextRange()
PsiElementpublic int getStartOffsetInParent()
PsiElementpublic int getTextLength()
PsiElementpublic PsiElement findElementAt(int offset)
PsiElementoffset - the relative offset for which the PSI element is requested.public int getTextOffset()
PsiElementPsiNamedElement, this should return the offset in the file of the
name identifier.)public java.lang.String getText()
PsiElementPsiElement.textMatches(java.lang.CharSequence),
PsiElement.textContains(char)public char [] textToCharArray()
PsiElementpublic boolean textContains(char c)
PsiElementtextContains in interface PsiElementtextContains in class PsiElementBasec - the character to search for.public <T> T getCopyableUserData(Key<T> key)
PsiElementgetCopyableUserData in interface PsiElementgetCopyableUserData in class UserDataHolderBasekey - the key for accessing the user data object.PsiElement.putCopyableUserData(Key, Object)public <T> void putCopyableUserData(Key<T> key, T value)
PsiElementputCopyableUserData in interface PsiElementputCopyableUserData in class UserDataHolderBasekey - the key for accessing the user data object.value - the user data object to attach.PsiElement.getCopyableUserData(Key)public abstract ASTNode getNode()
PsiElementpublic void subtreeChanged()
public Language getLanguage()
PsiElementprotected <T extends PsiElement> T findChildByType(IElementType type)
protected <T extends PsiElement> T findLastChildByType(IElementType type)
protected <T extends PsiElement> T findNotNullChildByType(IElementType type)
protected <T extends PsiElement> T findChildByType(TokenSet type)
protected <T extends PsiElement> T findNotNullChildByType(TokenSet type)
protected PsiElement findChildByFilter(TokenSet tokenSet)
protected <T extends PsiElement> T [] findChildrenByType(IElementType elementType, java.lang.Class<T> arrayClass)
protected <T extends PsiElement> java.util.List<T> findChildrenByType(TokenSet elementType)
protected <T extends PsiElement> java.util.List<T> findChildrenByType(IElementType elementType)
protected <T extends PsiElement> T [] findChildrenByType(TokenSet elementType, java.lang.Class<T> arrayClass)
public PsiElement copy()
PsiElementcopy in interface PsiElementcopy in class PsiElementBasepublic PsiElement add(PsiElement element) throws IncorrectOperationException
PsiElementadd in interface PsiElementadd in class PsiElementBaseelement - the child element to add.element or its copy).IncorrectOperationException - if the modification is not supported or not possible for some reason.public PsiElement addBefore(PsiElement element, PsiElement anchor) throws IncorrectOperationException
PsiElementaddBefore in interface PsiElementaddBefore in class PsiElementBaseelement - the child element to add.anchor - the anchor before which the child element is inserted (must be a child of this PSI element)element or its copy).IncorrectOperationException - if the modification is not supported or not possible for some reason.public PsiElement addAfter(PsiElement element, PsiElement anchor) throws IncorrectOperationException
PsiElementaddAfter in interface PsiElementaddAfter in class PsiElementBaseelement - the child element to add.anchor - the anchor after which the child element is inserted (must be a child of this PSI element)element or its copy).IncorrectOperationException - if the modification is not supported or not possible for some reason.public void checkAdd(PsiElement element) throws IncorrectOperationException
PsiElementcheckAdd in interface PsiElementcheckAdd in class PsiElementBaseelement - the child element to check the add possibility.IncorrectOperationException - if the modification is not supported or not possible for some reason.public ASTNode addInternal(ASTNode first, ASTNode last, ASTNode anchor, java.lang.Boolean before)
public PsiElement addRange(PsiElement first, PsiElement last) throws IncorrectOperationException
PsiElementaddRange in interface PsiElementaddRange in class PsiElementBasefirst - the first child element to add.last - the last child element to add (must have the same parent as first)first or its copy).IncorrectOperationException - if the modification is not supported or not possible for some reason.public PsiElement addRangeBefore(PsiElement first, PsiElement last, PsiElement anchor) throws IncorrectOperationException
PsiElementaddRangeBefore in interface PsiElementaddRangeBefore in class PsiElementBasefirst - the first child element to add.last - the last child element to add (must have the same parent as first)anchor - the anchor before which the child element is inserted (must be a child of this PSI element)first or its copy).IncorrectOperationException - if the modification is not supported or not possible for some reason.public PsiElement addRangeAfter(PsiElement first, PsiElement last, PsiElement anchor) throws IncorrectOperationException
PsiElementaddRangeAfter in interface PsiElementaddRangeAfter in class PsiElementBasefirst - the first child element to add.last - the last child element to add (must have the same parent as first)anchor - the anchor after which the child element is inserted (must be a child of this PSI element)first or its copy).IncorrectOperationException - if the modification is not supported or not possible for some reason.public void delete()
throws IncorrectOperationException
PsiElementdelete in interface PsiElementdelete in class PsiElementBaseIncorrectOperationException - if the modification is not supported
or not possible for some reason (for example, the file containing the element is read-only).public void deleteChildInternal(ASTNode child)
public void checkDelete()
throws IncorrectOperationException
PsiElementcheckDelete in interface PsiElementcheckDelete in class PsiElementBaseIncorrectOperationException - if the modification is not supported or not possible for some reason.public void deleteChildRange(PsiElement first, PsiElement last) throws IncorrectOperationException
PsiElementdeleteChildRange in interface PsiElementdeleteChildRange in class PsiElementBasefirst - the first child to delete (must be a child of this PSI element)last - the last child to delete (must be a child of this PSI element)IncorrectOperationException - if the modification is not supported or not possible for some reason.public PsiElement replace(PsiElement newElement) throws IncorrectOperationException
PsiElementreplace in interface PsiElementreplace in class PsiElementBasenewElement - the element to replace this element with.newElement or its copy)IncorrectOperationException - if the modification is not supported or not possible for some reason.public void replaceChildInternal(PsiElement child, TreeElement newElement)
public boolean textMatches(java.lang.CharSequence text)
PsiElementtextMatches in interface PsiElementtextMatches in class PsiElementBasetext - the character sequence to compare with.