Class ParseExpression

java.lang.Object
org.chenile.ognl.ParseExpression

public class ParseExpression extends Object
Wrapper around Ognl.parseExpression() which uses caching. Provides optimized access to an expression. Expressions must be parsed first using the parseIt() method before they are used using Ognl.
Author:
raja
  • Field Details

    • parsedExpressionMap

      private static Map<String,Object> parsedExpressionMap
  • Constructor Details

    • ParseExpression

      public ParseExpression()
  • Method Details

    • init

      public static void init()
    • parseIt

      public static Object parseIt(String code) throws ognl.OgnlException
      .
      Parameters:
      code - .
      Returns:
      .
      Throws:
      ognl.OgnlException - .
    • sanitizeExpression

      private static String sanitizeExpression(String code)
      tighten the code.. remove \ns and \ts , fuse multiple spaces into one, remove leading and trailing spaces etc. All semi-colons are replaced by commas since OGNL supports only expressions not statements Ensure that the code does not end with , since OGNL will crap out.
      Parameters:
      code - .
      Returns:
      .