org.eclipse.jface.text.rules
Class RuleBasedPartitionScanner
java.lang.Object
|
+--org.eclipse.jface.text.rules.RuleBasedScanner
|
+--org.eclipse.jface.text.rules.BufferedRuleBasedScanner
|
+--org.eclipse.jface.text.rules.RuleBasedPartitionScanner
- All Implemented Interfaces:
- ICharacterScanner, IPartitionTokenScanner, ITokenScanner
- public class RuleBasedPartitionScanner
- extends BufferedRuleBasedScanner
- implements IPartitionTokenScanner
Scanner that exclusively uses predicate rules.
- Since:
- 2.0
Field Summary |
protected String |
fContentType
The content type of the partition in which to resume scanning. |
protected int |
fPartitionOffset
The offset of the partition inside which to resume. |
Method Summary |
IToken |
nextToken()
Returns the next token in the document. |
void |
setPartialRange(IDocument document,
int offset,
int length,
String contentType,
int partitionOffset)
Configures the scanner by providing access to the document range that should be scanned. |
void |
setPredicateRules(IPredicateRule[] rules)
|
void |
setRange(IDocument document,
int offset,
int length)
Configures the scanner by providing access to the document range that should
be scanned. |
void |
setRules(IRule[] rules)
Configures the scanner with the given sequence of rules. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
fContentType
protected String fContentType
- The content type of the partition in which to resume scanning.
fPartitionOffset
protected int fPartitionOffset
- The offset of the partition inside which to resume.
RuleBasedPartitionScanner
public RuleBasedPartitionScanner()
setRules
public void setRules(IRule[] rules)
- Description copied from class:
RuleBasedScanner
- Configures the scanner with the given sequence of rules.
- Overrides:
setRules
in class RuleBasedScanner
- Following copied from class:
org.eclipse.jface.text.rules.RuleBasedScanner
- Parameters:
rules
- the sequence of rules controlling this scanner
setPredicateRules
public void setPredicateRules(IPredicateRule[] rules)
setRange
public void setRange(IDocument document,
int offset,
int length)
- Description copied from interface:
ITokenScanner
- Configures the scanner by providing access to the document range that should
be scanned.
- Specified by:
setRange
in interface ITokenScanner
- Overrides:
setRange
in class BufferedRuleBasedScanner
- Following copied from interface:
org.eclipse.jface.text.rules.ITokenScanner
- Parameters:
document
- the document to scanoffset
- the offset of the document range to scanlength
- the length of the document range to scan
setPartialRange
public void setPartialRange(IDocument document,
int offset,
int length,
String contentType,
int partitionOffset)
- Description copied from interface:
IPartitionTokenScanner
- Configures the scanner by providing access to the document range that should be scanned.
The range may no only contain complete partitions but starts at the beginning of a line in the
middle of a partition of the given content type. This requires that a partition delimiter can not
contain a line delimiter.
- Specified by:
setPartialRange
in interface IPartitionTokenScanner
- Following copied from interface:
org.eclipse.jface.text.rules.IPartitionTokenScanner
- Parameters:
document
- the document to scanoffset
- the offset of the document range to scanlength
- the length of the document range to scancontentType
- the content type at the given offsetpartitionOffset
- the offset at which the partition of the given offset starts
nextToken
public IToken nextToken()
- Description copied from interface:
ITokenScanner
- Returns the next token in the document.
- Specified by:
nextToken
in interface ITokenScanner
- Overrides:
nextToken
in class RuleBasedScanner
- Following copied from interface:
org.eclipse.jface.text.rules.ITokenScanner
- Returns:
- the next token in the document
Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.