Class EvalHelper

java.lang.Object
spoon.support.reflect.eval.EvalHelper

public class EvalHelper extends Object
  • Method Details

    • convertElementToRuntimeObject

      public static Object convertElementToRuntimeObject(CtElement value)
      Evaluates and converts CtExpression to their equivalent runtime objects eg "CtLiteral(3) + CtLiteral(4)" -> 7
    • getCorrespondingRuntimeObject

      public static Object getCorrespondingRuntimeObject(CtExpression<?> value)
      Returns the runtime object corresponding to the expression eg CtLiteral(3) -> 3
    • isKnownAtCompileTime

      public static boolean isKnownAtCompileTime(CtExpression<?> exp)
      returns true if the expression is known at compile time Bonus method for @oscarlvp :-)