|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.progeeks.util.TemplateExpressionProcessor
public class TemplateExpressionProcessor
Interacts with the SimpleExpressionLanguage to allow basic variable substitution within string template expressions. Expressions are specified with a syntax similar to what ANT uses for property references, ie: ${some.property}
Nested Class Summary | |
---|---|
protected static class |
TemplateExpressionProcessor.NestedExpressionElement
A nested TemplateExpression within a TemplateExpression. |
protected static class |
TemplateExpressionProcessor.ReferenceElement
A variable reference within a TemplateExpression. |
static class |
TemplateExpressionProcessor.TemplateExpression
Represents a template expression string as a formal type that can be used to clarify method arguments, etc. |
Field Summary | |
---|---|
static java.lang.String[] |
STANDARD_EXAMPLES
|
Constructor Summary | |
---|---|
TemplateExpressionProcessor(java.lang.Object target,
SimpleExpressionLanguage el)
Creates a new template processor that will operate on the specified target using the specified expression language for lookups. |
|
TemplateExpressionProcessor(SimpleExpressionLanguage el)
Creates an untargeted template processor that will use the specified SimpleExpressionLanguage for lookups. |
Method Summary | |
---|---|
java.lang.Object |
evaluate(java.lang.String exp)
Evaluates the specified template expression string and returns the value. |
java.lang.Object |
evaluate(TemplateExpressionProcessor.TemplateExpression exp)
Evaluates the specified TemplateExpression and returns the value. |
protected java.lang.Object |
evaluateElement(java.lang.Object element)
Evaluates a single element. |
protected java.lang.StringBuffer |
evaluateElements(java.util.List elements)
|
static java.lang.Object |
evaluateTemplateExpression(java.lang.String exp)
Uses the thread's current context template processor to evaluate the specified template expression. |
static java.lang.Object |
evaluateTemplateExpression(TemplateExpressionProcessor.TemplateExpression exp)
Uses the thread's current context template processor to evaluate the specified template expression. |
static TemplateExpressionProcessor |
getContextProcessor()
Returns the thread's current context processor. |
SimpleExpressionLanguage |
getExpressionLanguage()
Returns the expression language instance used to parse and evaluate embedded variable look-up expressions. |
java.lang.Object |
getTarget()
Returns the target object used for embedded lookups. |
protected java.lang.Object |
lookupValue(java.lang.String expression)
Used internally to calculate the value for a reference element. |
static void |
main(java.lang.String[] args)
|
static void |
setContextProcessor(TemplateExpressionProcessor proc)
Sets the thread's context processor. |
void |
setTarget(java.lang.Object target)
Sets the target object used for embedded lookups. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String[] STANDARD_EXAMPLES
Constructor Detail |
---|
public TemplateExpressionProcessor(SimpleExpressionLanguage el)
public TemplateExpressionProcessor(java.lang.Object target, SimpleExpressionLanguage el)
Method Detail |
---|
public static void setContextProcessor(TemplateExpressionProcessor proc)
public static TemplateExpressionProcessor getContextProcessor()
protected java.lang.Object lookupValue(java.lang.String expression)
public void setTarget(java.lang.Object target)
public java.lang.Object getTarget()
public SimpleExpressionLanguage getExpressionLanguage()
protected java.lang.Object evaluateElement(java.lang.Object element)
protected java.lang.StringBuffer evaluateElements(java.util.List elements)
public java.lang.Object evaluate(TemplateExpressionProcessor.TemplateExpression exp)
public java.lang.Object evaluate(java.lang.String exp)
public static java.lang.Object evaluateTemplateExpression(TemplateExpressionProcessor.TemplateExpression exp)
public static java.lang.Object evaluateTemplateExpression(java.lang.String exp)
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |