java.lang.Object
com.sun.faces.facelets.el.ELText
Handles parsing EL Strings in accordance with the EL-API Specification. The parser accepts either
${..}
or #{..}
.- Version:
- $Id$
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionapply
(ExpressionFactory factory, ELContext ctx) Return an instance ofthis
that is applicable given the ELContext and ExpressionFactory state.boolean
If it's literal textstatic boolean
Parses the passed string to determine if it's literal or notstatic ELText
parse
(ExpressionFactory fact, ELContext ctx, String in) static ELText
parse
(ExpressionFactory fact, ELContext ctx, String in, String alias) Factory method for creating a validated ELText instance.static ELText
Factory method for creating an unvalidated ELText instance.static ELText
toString()
Evaluates the ELText to a Stringvoid
Allow this instance to write to the passed Writer, given the ELContext statevoid
writeText
(ResponseWriter out, ELContext ctx)
-
Field Details
-
literal
-
-
Constructor Details
-
ELText
-
-
Method Details
-
isLiteral
public boolean isLiteral()If it's literal text- Returns:
- true if the String is literal (doesn't contain
#{..}
or${..}
)
-
apply
Return an instance ofthis
that is applicable given the ELContext and ExpressionFactory state.- Parameters:
factory
- the ExpressionFactory to usectx
- the ELContext to use- Returns:
- an ELText instance
-
write
Allow this instance to write to the passed Writer, given the ELContext state- Parameters:
out
- Writer to write toctx
- current ELContext state- Throws:
ELException
- when an EL exception occursIOException
- when an I/O exception occurs
-
writeText
- Throws:
ELException
IOException
-
toString
Evaluates the ELText to a String- Parameters:
ctx
- current ELContext state- Returns:
- the evaluated String
- Throws:
ELException
- when an EL exception occurs
-
toString
-
isLiteral
Parses the passed string to determine if it's literal or not- Parameters:
in
- input String- Returns:
- true if the String is literal (doesn't contain
#{..}
or${..}
)
-
parse
Factory method for creating an unvalidated ELText instance. NOTE: All expressions in the passed String are treated asELText.LiteralValueExpression
, with one exception: composite component expressions. These are treated as ContextualCompositeValueExpressions.- Parameters:
in
- String to parse- Returns:
- ELText instance that knows if the String was literal or not
- Throws:
ELException
- when an EL exception occurs
-
parse
- Throws:
ELException
-
parse
- Throws:
ELException
-
parse
public static ELText parse(ExpressionFactory fact, ELContext ctx, String in, String alias) throws ELException Factory method for creating a validated ELText instance. When an Expression is hit, it will use the ExpressionFactory to create a ValueExpression instance, resolving any functions at that time. Variables and properties will not be evaluated.- Parameters:
fact
- ExpressionFactory to usectx
- ELContext to validate againstin
- String to parsealias
- the alias- Returns:
- ELText that can be re-applied later
- Throws:
ELException
- when an EL exception occurs
-