All Packages Class Hierarchy This Package Previous Next Index
Class JavaAgent.resource.cdl.ExpressionReader
java.lang.Object
|
+----java.io.Reader
|
+----java.io.InputStreamReader
|
+----JavaAgent.resource.cdl.ExpressionReader
- public class ExpressionReader
- extends InputStreamReader
This class is a special reader that takes an InputStream and gets complete
expressions from that stream. As there is no syntax for expressions all
the reader does is count the number of brackets to determine where an
expressions begins and ends.
-
ExpressionReader(InputStream)
- The constructor for an ExpressionReader takes an InputStream and
calls the according constructor for an InputStreamReader.
-
readExpression()
- This function gets the next expression from the InputStream of this
ExpressionReader.
ExpressionReader
public ExpressionReader(InputStream in)
- The constructor for an ExpressionReader takes an InputStream and
calls the according constructor for an InputStreamReader.
- Parameters:
- in - the InputStream expressions are to be read from
readExpression
public String readExpression() throws IOException
- This function gets the next expression from the InputStream of this
ExpressionReader. It ignores all characters until it finds an open
bracket (round, square, or curly). This is where the expression starts.
It will keep reading until the matching brcket is found and the
expression ends there. However, this function only counts brackets and
the type of bracket (round, square, or curly) is ignored. If no more
expression can be read the result will be null.
- Returns:
- the String representing the next expression or null
- Throws: IOException
- An exception can occur if reading from the given
InputStream fails or the stream finishes before a matching closing
bracket in an expression has been found.
All Packages Class Hierarchy This Package Previous Next Index