intarsys runtime library

de.intarsys.tools.expression
Class TaggedStringEvaluator

java.lang.Object
  extended by de.intarsys.tools.expression.TaggedStringEvaluator
All Implemented Interfaces:
IStringEvaluator

public class TaggedStringEvaluator
extends Object
implements IStringEvaluator

An IStringEvaluator for string templates. The evaluator handles strings of the form
[ chars | "${" chars "}" ]* , literally copying all chars outside the "${ }" tags and expanding all tagged content using the supplied IStringEvaluator.


Constructor Summary
TaggedStringEvaluator(IStringEvaluator resolver)
           
TaggedStringEvaluator(IStringEvaluator resolver, boolean escape)
           
 
Method Summary
 Object evaluate(String expression, IArgs args)
          Evaluate an expression according to the syntax used by the implementor and return the result.
 IStringEvaluator getEvaluator()
           
 boolean isEscape()
           
 boolean isSwallowExceptions()
           
 void setEscape(boolean escape)
           
 void setSwallowExceptions(boolean swallowExceptions)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TaggedStringEvaluator

public TaggedStringEvaluator(IStringEvaluator resolver)

TaggedStringEvaluator

public TaggedStringEvaluator(IStringEvaluator resolver,
                             boolean escape)
Method Detail

evaluate

public Object evaluate(String expression,
                       IArgs args)
                throws EvaluationException
Description copied from interface: IStringEvaluator
Evaluate an expression according to the syntax used by the implementor and return the result.

Specified by:
evaluate in interface IStringEvaluator
Parameters:
expression - The expression to evaluate.
Returns:
The result object.
Throws:
EvaluationException - If we encounter a compile or runtime error.

getEvaluator

public IStringEvaluator getEvaluator()

isEscape

public boolean isEscape()

isSwallowExceptions

public boolean isSwallowExceptions()

setEscape

public void setEscape(boolean escape)

setSwallowExceptions

public void setSwallowExceptions(boolean swallowExceptions)

intarsys runtime library

Copyright © 2012 intarsys consulting GmbH. All Rights Reserved.