SMACS

smacs.xngr.browser.editor
Class XmlScanner

java.lang.Object
  extended bysmacs.xngr.browser.editor.XmlScanner

public class XmlScanner
extends Object

Associates XML input stream characters with styles specific for the XML Editor.

Note: The XML 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/

Author:
Edwin Dankert

Field Summary
protected  XmlInputReader in
           
 long pos
           
 int token
           
 
Constructor Summary
XmlScanner(Document document)
          Constructs a scanner for the Document.
 
Method Summary
 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.
 long scan()
          Scans the Xml Stream for XML specific tokens.
 void setRange(int start, int end)
          Sets the scanning range.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

in

protected XmlInputReader in

token

public int token

pos

public long pos
Constructor Detail

XmlScanner

public XmlScanner(Document document)
           throws IOException
Constructs a scanner for the Document.

Parameters:
document - the document containing the XML content.
Method Detail

setRange

public void setRange(int start,
                     int end)
              throws IOException
Sets the scanning range.

Parameters:
start - the start of the range.
end - the end of the range.
Throws:
IOException

getStartOffset

public final int getStartOffset()
Gets the starting location of the current token in the document.

Returns:
the starting location.

getEndOffset

public final int getEndOffset()
Gets the end location of the current token in the document.

Returns:
the end location.

scan

public long scan()
          throws IOException
Scans the Xml Stream for XML specific tokens.

Returns:
the last location.
Throws:
IOException

SMACS