Class ELText


  • 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
    • 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​(jakarta.el.ExpressionFactory factory,
                            jakarta.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,
                          jakarta.el.ELContext ctx)
                   throws jakarta.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:
        jakarta.el.ELException - when an EL exception occurs
        IOException - when an I/O exception occurs
      • toString

        public String toString​(jakarta.el.ELContext ctx)
                        throws jakarta.el.ELException
        Evaluates the ELText to a String
        Parameters:
        ctx - current ELContext state
        Returns:
        the evaluated String
        Throws:
        jakarta.el.ELException - when an EL exception occurs
      • 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 jakarta.el.ELException
        Factory method for creating an unvalidated ELText instance. NOTE: All expressions in the passed String are treated as ELText.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:
        jakarta.el.ELException - when an EL exception occurs
      • parse

        public static ELText parse​(String in,
                                   String alias)
                            throws jakarta.el.ELException
        Throws:
        jakarta.el.ELException
      • parse

        public static ELText parse​(jakarta.el.ExpressionFactory fact,
                                   jakarta.el.ELContext ctx,
                                   String in)
                            throws jakarta.el.ELException
        Throws:
        jakarta.el.ELException
      • parse

        public static ELText parse​(jakarta.el.ExpressionFactory fact,
                                   jakarta.el.ELContext ctx,
                                   String in,
                                   String alias)
                            throws jakarta.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
        alias - the alias
        Returns:
        ELText that can be re-applied later
        Throws:
        jakarta.el.ELException - when an EL exception occurs