Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.sun.facelets.el
Class ELText  view ELText download ELText.java

java.lang.Object
  extended bycom.sun.facelets.el.ELText
Direct Known Subclasses:
ELText.ELTextComposite, ELText.ELTextVariable

public class ELText
extends java.lang.Object

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

Version:
$Id: ELText.java,v 1.5 2006/05/09 06:25:39 jhook Exp $

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

Field Detail

literal

protected final java.lang.String literal
Constructor Detail

ELText

public ELText(java.lang.String literal)
Method Detail

isLiteral

public boolean isLiteral()
If it's literal text


apply

public ELText apply(ExpressionFactory factory,
                    ELContext ctx)
Return an instance of this that is applicable given the ELContext and ExpressionFactory state.


write

public void write(java.io.Writer out,
                  ELContext ctx)
           throws ELException,
                  java.io.IOException
Allow this instance to write to the passed Writer, given the ELContext state


writeText

public void writeText(javax.faces.context.ResponseWriter out,
                      ELContext ctx)
               throws ELException,
                      java.io.IOException

toString

public java.lang.String toString(ELContext ctx)
                          throws ELException
Evaluates the ELText to a String


toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).


isLiteral

public static boolean isLiteral(java.lang.String in)
Parses the passed string to determine if it's literal or not


parse

public static ELText parse(java.lang.String in)
                    throws ELException
Factory method for creating an unvalidated ELText instance. NOTE: All expressions in the passed String are treated as LiteralValueExpressions.


parse

public static ELText parse(ExpressionFactory fact,
                           ELContext ctx,
                           java.lang.String in)
                    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.


findVarLength

private static int findVarLength(char[] ca,
                                 int s)
                          throws ELException