public class RuleBasedPartitionScanner extends BufferedRuleBasedScanner implements IPartitionTokenScanner
If a partial range is set (see setPartialRange(IDocument, int, int, String, int) with
content type that is not null then this scanner will first try the rules that match
the given content type.
| Modifier and Type | Field and Description |
|---|---|
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.
|
fColumn, fDefaultReturnToken, fDelimiters, fDocument, fOffset, fRangeEnd, fRules, fTokenOffset, UNDEFINEDEOF| Constructor and Description |
|---|
RuleBasedPartitionScanner() |
| Modifier and Type | Method and Description |
|---|---|
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)
Disallow setting the rules since this scanner
exclusively uses predicate rules.
|
read, setBufferSize, unreadgetColumn, getLegalLineDelimiters, getTokenLength, getTokenOffset, setDefaultReturnTokenclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetTokenLength, getTokenOffsetprotected String fContentType
protected int fPartitionOffset
public void setRules(IRule[] rules)
setRules in class RuleBasedScannerrules - the sequence of rules controlling this scannerpublic void setPredicateRules(IPredicateRule[] rules)
public void setRange(IDocument document, int offset, int length)
ITokenScannersetRange in interface ITokenScannersetRange in class BufferedRuleBasedScannerdocument - the document to scanoffset - the offset of the document range to scanlength - the length of the document range to scanpublic void setPartialRange(IDocument document, int offset, int length, String contentType, int partitionOffset)
If the given content type is not null then this scanner will first try the rules
that match the given content type.
setPartialRange in interface IPartitionTokenScannerdocument - 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 startspublic IToken nextToken()
ITokenScannernextToken in interface ITokenScannernextToken in class RuleBasedScanner
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.