|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.jett.expression.Expression
public class Expression
An Expression object represents a JEXL Expression that can
be evaluated given a Map of bean names to values. Many
Expressions may be created in a cell. Here in JETT,
Expressions are built from the text found in between "${" and
"}".
| Field Summary | |
|---|---|
static java.lang.String |
BEGIN_EXPR
Determines the start of a JEXL expression. |
static java.lang.String |
END_EXPR
Determines the end of a JEXL expression. |
| Constructor Summary | |
|---|---|
Expression(java.lang.String expression)
Create an Expression. |
|
| Method Summary | |
|---|---|
static void |
clearExpressionToCollNamesMap()
Clear the Map that is used to cache the fact that a certain
collection name may be present in expression text. |
java.lang.Object |
evaluate(java.util.Map<java.lang.String,java.lang.Object> beans)
Evaluate this Expression using the given Map of
beans as a context. |
static java.lang.Object |
evaluateString(org.apache.poi.ss.usermodel.RichTextString richTextString,
org.apache.poi.ss.usermodel.CreationHelper helper,
java.util.Map<java.lang.String,java.lang.Object> beans)
Find any Expressions embedded in the given string, evaluate
them, and replace the expressions with the resulting values. |
static java.lang.Object |
evaluateString(java.lang.String value,
java.util.Map<java.lang.String,java.lang.Object> beans)
Find any Expressions embedded in the given string, evaluate
them, and replace the expressions with the resulting values. |
static java.util.List<java.lang.String> |
getImplicitCollectionExpr(java.lang.String value,
java.util.Map<java.lang.String,java.lang.Object> beans,
java.util.List<java.lang.String> noImplProcCollNames)
Determines whether a string representing an Expression
represents implicit Collections access, which would result in an implicit
collections processing loop. |
java.lang.String |
getValueIndicatingImplicitCollection(java.util.Map<java.lang.String,java.lang.Object> beans,
java.util.List<java.lang.String> noImplProcCollNames)
Determines whether this represents implicit Collections access, which would result in an implicit collections processing loop. |
| 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 BEGIN_EXPR
public static final java.lang.String END_EXPR
| Constructor Detail |
|---|
public Expression(java.lang.String expression)
Expression.
expression - The expression in String form.| Method Detail |
|---|
public java.lang.Object evaluate(java.util.Map<java.lang.String,java.lang.Object> beans)
Expression using the given Map of
beans as a context.
beans - A Map mapping strings to objects.
public java.lang.String getValueIndicatingImplicitCollection(java.util.Map<java.lang.String,java.lang.Object> beans,
java.util.List<java.lang.String> noImplProcCollNames)
Determines whether this represents implicit Collections access, which
would result in an implicit collections processing loop. If so, then it
returns the substring representing the Collection, else it
returns null.
This method uses JEXL internal parser logic.
beans - A Map mapping strings to objects.noImplProcCollNames - Don't return a collection expression whose
collection property name is found in this List.
Collection, or
null if it doesn't represent implicit Collections access.public static void clearExpressionToCollNamesMap()
Map that is used to cache the fact that a certain
collection name may be present in expression text. Call this method when
a new beans Map is being used, which would render the cache
useless. Such a situation arises when supplying multiple bean maps to
the transform method on ExcelTransformer, and
we are moving to a new Sheet, or if either
transform method on ExcelTransformer is called
more than once.
public static java.util.List<java.lang.String> getImplicitCollectionExpr(java.lang.String value,
java.util.Map<java.lang.String,java.lang.Object> beans,
java.util.List<java.lang.String> noImplProcCollNames)
Expression
represents implicit Collections access, which would result in an implicit
collections processing loop. If so, then it returns the substring
representing the Collection, else it returns
null.
value - The string possibly representing an Expression.beans - A Map mapping strings to objects.noImplProcCollNames - Don't return a collection expression whose
collection property name is found in this List.
List of strings representing the
Collections found, possibly empty if it doesn't represent
implicit Collections access.
public static java.lang.Object evaluateString(org.apache.poi.ss.usermodel.RichTextString richTextString,
org.apache.poi.ss.usermodel.CreationHelper helper,
java.util.Map<java.lang.String,java.lang.Object> beans)
Expressions embedded in the given string, evaluate
them, and replace the expressions with the resulting values. If the
entire string consists of one Expression, then the returned
value may be any Object.
richTextString - The rich text string, with possibly embedded
expressions.helper - A CreationHelper that can create the proper
RichTextString.beans - A Map mapping strings to objects.
public static java.lang.Object evaluateString(java.lang.String value,
java.util.Map<java.lang.String,java.lang.Object> beans)
Expressions embedded in the given string, evaluate
them, and replace the expressions with the resulting values. If the
entire string consists of one Expression, then the returned
value may be any Object.
value - The string, with possibly embedded expressions.beans - A Map mapping strings to objects.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||