ref_send API 2.17
defensive programming in Java

org.waterken.syntax.json
Class JSONLexer

java.lang.Object
  extended by org.waterken.syntax.json.JSONLexer

public final class JSONLexer
extends java.lang.Object

A JSON token reader.


Constructor Summary
JSONLexer(java.io.Reader in)
          Constructs an instance.
 
Method Summary
 void close()
           
 int getColumn()
          Gets the column number of the head token.
 java.lang.String getHead()
          Gets the most recently read token.
 int getLine()
          Gets the line number of the head token.
 java.lang.String next()
          Move to the next token in the input stream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSONLexer

public JSONLexer(java.io.Reader in)
Constructs an instance.

Parameters:
in - UTF-8 input stream
Method Detail

getLine

public int getLine()
Gets the line number of the head token.


getColumn

public int getColumn()
Gets the column number of the head token.


getHead

public java.lang.String getHead()
Gets the most recently read token.

Returns:
most recent token, or null if EOF

next

public java.lang.String next()
                      throws java.io.EOFException,
                             java.io.IOException,
                             java.lang.Exception
Move to the next token in the input stream.

Returns:
newly read token
Throws:
java.io.EOFException - EOF
java.io.IOException - any I/O error
java.lang.Exception - invalid character escape

close

public void close()
           throws java.io.IOException
Throws:
java.io.IOException

ref_send API 2.17
defensive programming in Java

Submit a bug or feature, or get help

Copyright 1998-2009 Waterken Inc. under the terms of the MIT X license.