public abstract class SyntaxHighlightingScanner extends Object
Note: The Editor package is based on the JavaEditorKit example as described in the article 'Customizing a Text Editor' by Timothy Prinzing . See: http://java.sun.com/products/jfc/tsc/articles/text/editor_kit/
Modifier and Type | Field and Description |
---|---|
protected boolean |
error |
protected DocumentInputReader |
in |
protected long |
pos |
protected int |
start |
String |
token
The last token scanned
|
protected boolean |
valid |
Constructor and Description |
---|
SyntaxHighlightingScanner(Document document)
Constructs a scanner for the Document.
|
Modifier and Type | Method and Description |
---|---|
int |
getEndOffset()
Gets the end location of the current token in the document.
|
int |
getStartOffset()
Gets the starting location of the current token in the document.
|
boolean |
isError() |
boolean |
isValid()
Returns true when no paint has invalidated the scanner.
|
abstract long |
scan()
Scans the Xml Stream for XML specific tokens.
|
void |
setRange(int start,
int end)
Sets the scanning range.
|
void |
setValid(boolean valid)
Set valid when correct range is set.
|
protected int start
protected long pos
protected boolean error
protected DocumentInputReader in
protected boolean valid
public String token
public SyntaxHighlightingScanner(Document document) throws IOException
document
- the document containing the XML content.IOException
public boolean isError()
public boolean isValid()
public void setValid(boolean valid)
valid
- when correct range set.public void setRange(int start, int end) throws IOException
start
- the start of the range.end
- the end of the range.IOException
public final int getStartOffset()
public final int getEndOffset()
public abstract long scan() throws IOException
IOException
Copyright © 2002-2013 Edwin Dankert. All Rights Reserved.