org.objectweb.cjdbc.test.util
Class MyBufferedReader

java.lang.Object
  extended byjava.io.Reader
      extended byjava.io.BufferedReader
          extended byorg.objectweb.cjdbc.test.util.MyBufferedReader

public class MyBufferedReader
extends java.io.BufferedReader

I/O utilitary method.

Author:
Mathieu Peltier

Field Summary
private static java.lang.String BEGIN_REQUEST
          Begin request token.
private static java.lang.String END_REQUEST
          End request token.
private  java.lang.String fileDescription
          File title (eg: 'requests').
 
Fields inherited from class java.io.BufferedReader
 
Fields inherited from class java.io.Reader
lock
 
Constructor Summary
MyBufferedReader(java.io.Reader reader, java.lang.String description)
          Creates a new MyBufferedReader instance.
 
Method Summary
 boolean readBoolean()
          Convenient method to read a boolean value in a text file.
 java.lang.String readSQLRequest(java.lang.String line)
          Convenient method to read a SQL request in a text file.
 java.lang.String readString(java.lang.String stringName)
          Convenient method to read a Strong value in a text file.
 
Methods inherited from class java.io.BufferedReader
close, mark, markSupported, read, read, readLine, ready, reset, skip
 
Methods inherited from class java.io.Reader
read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BEGIN_REQUEST

private static final java.lang.String BEGIN_REQUEST
Begin request token.

See Also:
Constant Field Values

END_REQUEST

private static final java.lang.String END_REQUEST
End request token.

See Also:
Constant Field Values

fileDescription

private java.lang.String fileDescription
File title (eg: 'requests'). Allow to contruct better error messages.

Constructor Detail

MyBufferedReader

public MyBufferedReader(java.io.Reader reader,
                        java.lang.String description)
Creates a new MyBufferedReader instance.

Parameters:
reader - a Reader instance.
description - description text.
Method Detail

readBoolean

public boolean readBoolean()
                    throws java.io.IOException
Convenient method to read a boolean value in a text file.

Returns:
the boolean read.
Throws:
java.io.IOException - if error occurs.

readString

public java.lang.String readString(java.lang.String stringName)
                            throws java.io.IOException
Convenient method to read a Strong value in a text file.

Parameters:
stringName - name of the property to read.
Returns:
the String read.
Throws:
java.io.IOException - if error occurs.

readSQLRequest

public java.lang.String readSQLRequest(java.lang.String line)
                                throws java.io.IOException
Convenient method to read a SQL request in a text file. The request must be delimited by the BEGIN_REQUEST and END_REQUEST tokens.

Parameters:
line - text file line.
Returns:
the String read.
Throws:
java.io.IOException - if error occurs.


Copyright © 2002, 2003 - ObjectWeb Consortium - All Rights Reserved.