站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

TokenHierarchyControl (Lexer) - NetBeans API Javadoc (Current Development Version)

org.netbeans.modules.lexer/2 1.19.0 1

org.netbeans.spi.lexer
Class TokenHierarchyControl<I>

java.lang.Object
  extended by org.netbeans.spi.lexer.TokenHierarchyControl<I>

public final class TokenHierarchyControl<I>
extends Object

Control class for managing token hierarchy of a mutable text input.


Method Summary
 boolean isActive()
           
 void rebuild()
          Rebuild token hierarchy completely.
 void setActive(boolean active)
          Making the token hierarchy inactive will release all the tokens in the hierarchy so that there will be no tokens.
 void textModified(int offset, int removedLength, CharSequence removedText, int insertedLength)
          Notify that the text of the mutable text input was modified.
 TokenHierarchy<I> tokenHierarchy()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

tokenHierarchy

public TokenHierarchy<I> tokenHierarchy()

textModified

public void textModified(int offset,
                         int removedLength,
                         CharSequence removedText,
                         int insertedLength)
Notify that the text of the mutable text input was modified.

Parameters:
offset - >=0 offset where the modification occurred.
removedLength - >=0 number of characters removed from the input.
removedText - text removed from the input. If it's not available to determine the removed text then this parameter may be null.
Providing of the removed text allows the incremental algorithm to use an efficient token validation if possible.
insertedLength - >=0 number of characters inserted at the offset after the removal.

setActive

public void setActive(boolean active)
Making the token hierarchy inactive will release all the tokens in the hierarchy so that there will be no tokens.


isActive

public boolean isActive()

rebuild

public void rebuild()
Rebuild token hierarchy completely.
This may be necessary if lexing depends on some input properties that get changed.
This method will drop all present tokens and let them to be lazily recreated.
This method should only be invoked under modification lock over the mutable input source (e.g. a document's write-lock). Otherwise all the active token sequences would fail with ConcurrentModificationException.


org.netbeans.modules.lexer/2 1.19.0 1

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.