ariba.util.io
Class TokenGenerator

java.lang.Object
  extended by java.io.Reader
      extended by java.io.FilterReader
          extended by ariba.util.io.TokenGenerator
All Implemented Interfaces:
java.io.Closeable, java.lang.Readable

public class TokenGenerator
extends java.io.FilterReader

TokenGenerator is a private class that transform an ASCII byte stream in tokens. This is class is used by the Deserializer.


Field Summary
static char ARRAY_BEGIN_TOKEN
           
static char ARRAY_END_TOKEN
           
static char GENERIC_SEP_TOKEN
           
static char HASHTABLE_BEGIN_TOKEN
           
static char HASHTABLE_END_TOKEN
           
static char HASHTABLE_KEY_VALUE_END_TOKEN
           
static char HASHTABLE_KEY_VALUE_SEP_TOKEN
           
static char LAST_TOKEN_TYPE
           
static char NULL_TOKEN
           
static char NULL_VALUE_TOKEN
           
static char STRING_TOKEN
           
static char VECTOR_BEGIN_TOKEN
           
static char VECTOR_END_TOKEN
           
 
Constructor Summary
TokenGenerator(java.io.Reader in)
           
 
Method Summary
 char charForLastToken()
          Returns the ASCII byte that matches a given token.
 char[] charsForLastToken()
          Return the bytes parsed to generate the last returned token.
 boolean hasMoreTokens()
           
 int lineForLastToken()
          Return the line number for the last returned token
 int nextToken()
           
 int peekNextToken()
           
 
Methods inherited from class java.io.FilterReader
close, mark, markSupported, read, read, ready, reset, skip
 
Methods inherited from class java.io.Reader
read, read
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NULL_TOKEN

public static final char NULL_TOKEN
See Also:
Constant Field Values

STRING_TOKEN

public static final char STRING_TOKEN
See Also:
Constant Field Values

ARRAY_BEGIN_TOKEN

public static final char ARRAY_BEGIN_TOKEN
See Also:
Constant Field Values

ARRAY_END_TOKEN

public static final char ARRAY_END_TOKEN
See Also:
Constant Field Values

VECTOR_BEGIN_TOKEN

public static final char VECTOR_BEGIN_TOKEN
See Also:
Constant Field Values

VECTOR_END_TOKEN

public static final char VECTOR_END_TOKEN
See Also:
Constant Field Values

HASHTABLE_BEGIN_TOKEN

public static final char HASHTABLE_BEGIN_TOKEN
See Also:
Constant Field Values

HASHTABLE_KEY_VALUE_SEP_TOKEN

public static final char HASHTABLE_KEY_VALUE_SEP_TOKEN
See Also:
Constant Field Values

HASHTABLE_KEY_VALUE_END_TOKEN

public static final char HASHTABLE_KEY_VALUE_END_TOKEN
See Also:
Constant Field Values

HASHTABLE_END_TOKEN

public static final char HASHTABLE_END_TOKEN
See Also:
Constant Field Values

GENERIC_SEP_TOKEN

public static final char GENERIC_SEP_TOKEN
See Also:
Constant Field Values

NULL_VALUE_TOKEN

public static final char NULL_VALUE_TOKEN
See Also:
Constant Field Values

LAST_TOKEN_TYPE

public static final char LAST_TOKEN_TYPE
See Also:
Constant Field Values
Constructor Detail

TokenGenerator

public TokenGenerator(java.io.Reader in)
Method Detail

hasMoreTokens

public final boolean hasMoreTokens()
                            throws DeserializationException,
                                   java.io.IOException
Throws:
DeserializationException
java.io.IOException

nextToken

public final int nextToken()
                    throws DeserializationException,
                           java.io.IOException
Throws:
DeserializationException
java.io.IOException

peekNextToken

public final int peekNextToken()
                        throws DeserializationException,
                               java.io.IOException
Throws:
DeserializationException
java.io.IOException

charsForLastToken

public final char[] charsForLastToken()
Return the bytes parsed to generate the last returned token.


charForLastToken

public char charForLastToken()
Returns the ASCII byte that matches a given token. Use this method when the token is a separator (everything but a string).


lineForLastToken

public int lineForLastToken()
Return the line number for the last returned token



AribaWeb User Interface Development Framework
Copyright © 2000-2014 Ariba, Inc. All Rights Reserved.