org.apache.myfaces.view.facelets.el
Class ELText

java.lang.Object
  extended by org.apache.myfaces.view.facelets.el.ELText

public class ELText
extends Object

Handles parsing EL Strings in accordance with the EL-API Specification. The parser accepts either ${..} or #{..}.

Version:
$Id: ELText.java 1351627 2012-06-19 09:50:21Z lu4242 $
Author:
Jacob Hookom

Field Summary
protected  String literal
           
 
Constructor Summary
ELText(String literal)
           
 
Method Summary
 ELText apply(javax.el.ExpressionFactory factory, javax.el.ELContext ctx)
          Return an instance of this that is applicable given the ELContext and ExpressionFactory state.
 boolean isLiteral()
          If it's literal text
static boolean isLiteral(String in)
          Parses the passed string to determine if it's literal or not
static ELText parse(javax.el.ExpressionFactory fact, javax.el.ELContext ctx, String in)
          Factory method for creating a validated ELText instance.
static ELText parse(String in)
          Factory method for creating an unvalidated ELText instance.
 String toString()
           
 String toString(javax.el.ELContext ctx)
          Evaluates the ELText to a String
 void write(Writer out, javax.el.ELContext ctx)
          Allow this instance to write to the passed Writer, given the ELContext state
 void writeText(ResponseWriter out, javax.el.ELContext ctx)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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 of this that is applicable given the ELContext and ExpressionFactory state.

Parameters:
factory - the ExpressionFactory to use
ctx - 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 to
ctx - current ELContext state
Throws:
javax.el.ELException
IOException

writeText

public void writeText(ResponseWriter out,
                      javax.el.ELContext ctx)
               throws javax.el.ELException,
                      IOException
Throws:
javax.el.ELException
IOException

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

toString

public String toString()
Overrides:
toString in class Object

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
Factory method for creating an unvalidated ELText instance. NOTE: All expressions in the passed String are treated as LiteralValueExpressions.

Parameters:
in - String to parse
Returns:
ELText instance that knows if the String was literal or not
Throws:
javax.el.ELException

parse

public static ELText parse(javax.el.ExpressionFactory fact,
                           javax.el.ELContext ctx,
                           String in)
                    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 use
ctx - ELContext to validate against
in - String to parse
Returns:
ELText that can be re-applied later
Throws:
javax.el.ELException


Copyright © 2014 The Apache Software Foundation. All Rights Reserved.