echoxul.util.bean
Class ExpressionParser

java.lang.Object
  extended byechoxul.util.bean.ExpressionParser

public class ExpressionParser
extends java.lang.Object

The ExpressionParser class is responsible for parsing simple expressions into an Object value suitable for assignment. The expression syntax is quite simple and is constituted by the following types:

Examples:

This class also has support for reading an entire set of properties in standard java properties file format.

Author:
Terry Laurenzo

Constructor Summary
ExpressionParser()
           
 
Method Summary
 java.lang.Object parseExpression(java.lang.String expr)
          Parse an expression into a value.
 java.util.Map parseProperties(java.io.Reader in)
          Parse from a Reader that represents a properties file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpressionParser

public ExpressionParser()
Method Detail

parseProperties

public java.util.Map parseProperties(java.io.Reader in)
                              throws java.lang.IllegalArgumentException,
                                     java.io.IOException
Parse from a Reader that represents a properties file. This will return a Map of all associations in the file. The syntax is identical to standard java property files

Throws:
java.lang.IllegalArgumentException
java.io.IOException

parseExpression

public java.lang.Object parseExpression(java.lang.String expr)
                                 throws java.lang.IllegalArgumentException
Parse an expression into a value. Throw an IllegalArgumentException on syntax error.

Throws:
java.lang.IllegalArgumentException


Copyright © 2004 Terry Laurenzo. All Rights Reserved.