Class OgnlFactory

java.lang.Object
com.peterphi.std.guice.common.ognl.OgnlFactory

public final class OgnlFactory extends Object
  • Method Details

    • clear

      public static void clear()
    • getInstance

      public static OgnlEvaluator getInstance(Object root, String expression)
      Get an OGNL Evaluator for a particular expression with a given input
      Parameters:
      root - an example instance of the root object that will be passed to this OGNL evaluator
      expression - the OGNL expression
      Returns:
      See Also:
    • template

      public static String template(String template, Object root)
      Helper method that uses StrTemplate and evaluates OGNL expressions within ${...} blocks
      Parameters:
      template - the template text
      root - the root object for any OGNL invocations
      Returns:
    • newOgnlLookup

      public static org.apache.commons.lang.text.StrLookup newOgnlLookup(Object root)
      Creates a lookup helper for StrTemplate to allow the evaluation of OGNL blocks within strings.
      Callers should probably use template(String, Object) instead.
      Parameters:
      root - the root object for any OGNL invocations
      Returns: