Class ELText
- java.lang.Object
-
- org.apache.myfaces.view.facelets.el.ELText
-
- Direct Known Subclasses:
ELText.ELCacheableTextVariable,ELText.ELTextComposite,ELText.ELTextVariable
public class ELText extends Object
Handles parsing EL Strings in accordance with the EL-API Specification. The parser accepts either${..}or#{..}.- Version:
- $Id$
- Author:
- Jacob Hookom
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classELText.ELCacheableTextVariableprotected static classELText.ELTextCompositeprotected static classELText.ELTextVariableprotected static classELText.LiteralValueExpression
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ELTextapply(javax.el.ExpressionFactory factory, javax.el.ELContext ctx)Return an instance ofthisthat is applicable given the ELContext and ExpressionFactory state.booleanisLiteral()If it's literal textstatic booleanisLiteral(String in)Parses the passed string to determine if it's literal or notstatic booleanisLiteral(javax.el.ExpressionFactory fact, javax.el.ELContext ctx, String in)static ELTextparse(String in)static ELTextparse(String in, Location location)Factory method for creating an unvalidated ELText instance.static ELTextparse(javax.el.ExpressionFactory fact, javax.el.ELContext ctx, String in)static ELTextparse(javax.el.ExpressionFactory fact, javax.el.ELContext ctx, String in, Location location)Factory method for creating a validated ELText instance.static ELTextparseAllowEmptyString(String in, Location location)static ELText[]parseAsArray(String in, Location location)static ELText[]parseAsArray(javax.el.ExpressionFactory fact, javax.el.ELContext ctx, String in, Location location)static StringparseAsString(javax.el.ExpressionFactory fact, javax.el.ELContext ctx, String in)StringtoString()StringtoString(javax.el.ELContext ctx)Evaluates the ELText to a Stringvoidwrite(Writer out, javax.el.ELContext ctx)Allow this instance to write to the passed Writer, given the ELContext statevoidwriteText(ResponseWriter out, javax.el.ELContext ctx)
-
-
-
Field Detail
-
literal
protected final String literal
-
-
Constructor Detail
-
ELText
public ELText(String literal)
-
-
Method Detail
-
isLiteral
public boolean isLiteral()
If it's literal text- Returns:
- true if the String is literal (doesn't contain
#{..}or${..})
-
apply
public ELText apply(javax.el.ExpressionFactory factory, javax.el.ELContext ctx)
Return an instance ofthisthat is applicable given the ELContext and ExpressionFactory state.- Parameters:
factory- the ExpressionFactory to usectx- the ELContext to use- Returns:
- an ELText instance
-
write
public void write(Writer out, javax.el.ELContext ctx) throws javax.el.ELException, IOException
Allow this instance to write to the passed Writer, given the ELContext state- Parameters:
out- Writer to write toctx- current ELContext state- Throws:
javax.el.ELExceptionIOException
-
writeText
public void writeText(ResponseWriter out, javax.el.ELContext ctx) throws javax.el.ELException, IOException
- Throws:
javax.el.ELExceptionIOException
-
toString
public String toString(javax.el.ELContext ctx) throws javax.el.ELException
Evaluates the ELText to a String- Parameters:
ctx- current ELContext state- Returns:
- the evaluated String
- Throws:
javax.el.ELException
-
isLiteral
public static boolean isLiteral(String in)
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
public static ELText parse(String in) throws javax.el.ELException
- Throws:
javax.el.ELException
-
parse
public static ELText parse(String in, Location location) throws javax.el.ELException
Factory method for creating an unvalidated ELText instance. NOTE: All expressions in the passed String are treated asLocationValueExpression.- Parameters:
in- String to parselocation- The location- Returns:
- ELText instance that knows if the String was literal or not
- Throws:
jakarta.el.ELExceptionjavax.el.ELException
-
parseAllowEmptyString
public static ELText parseAllowEmptyString(String in, Location location) throws javax.el.ELException
- Throws:
javax.el.ELException
-
parseAsString
public static String parseAsString(javax.el.ExpressionFactory fact, javax.el.ELContext ctx, String in) throws javax.el.ELException
- Throws:
javax.el.ELException
-
parse
public static ELText parse(javax.el.ExpressionFactory fact, javax.el.ELContext ctx, String in) throws javax.el.ELException
- Throws:
javax.el.ELException
-
parse
public static ELText parse(javax.el.ExpressionFactory fact, javax.el.ELContext ctx, String in, Location location) throws javax.el.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 parselocation- The location- Returns:
- ELText that can be re-applied later
- Throws:
jakarta.el.ELExceptionjavax.el.ELException
-
parseAsArray
public static ELText[] parseAsArray(String in, Location location) throws javax.el.ELException
- Throws:
javax.el.ELException
-
parseAsArray
public static ELText[] parseAsArray(javax.el.ExpressionFactory fact, javax.el.ELContext ctx, String in, Location location) throws javax.el.ELException
- Throws:
javax.el.ELException
-
isLiteral
public static boolean isLiteral(javax.el.ExpressionFactory fact, javax.el.ELContext ctx, String in) throws javax.el.ELException- Throws:
javax.el.ELException
-
-