Class CFUtils


  • public final class CFUtils
    extends Object
    Utilities to help with CF related item.
    • Method Detail

      • findCfEval

        public static IEvaluator findCfEval​(Map<String,​Object> variables)
        Find the evaluator to use for CF.

        Cf provides an Evaluate method on the page object that can be used to evaluate strings. This method tries to find that method.

        Parameters:
        variables - the variables to scan
        Returns:
        the evaluate to use, or null
      • findUdfName

        public static String findUdfName​(Map<String,​Object> variables,
                                         String className,
                                         int stackIndex)
        CF doesn't use the java method name, so we look for the UDF method name in the variables.
        Parameters:
        variables - the variables to look in
        className - the name of the class
        stackIndex - the stack index
        Returns:
        the name of the UDF method, or null
      • findPage

        public static Object findPage​(Map<String,​Object> localVars)
        Find the page object.
        Parameters:
        localVars - the variables to scan
        Returns:
        the page object or null
      • findPageContext

        public static Object findPageContext​(Map<String,​Object> localVars)
        Find the page context for cf.
        Parameters:
        localVars - the variables to search
        Returns:
        the page context or null
      • isCfClass

        public static boolean isCfClass​(String classname)
        Is this class a possible cf class.
        Parameters:
        classname - the class name
        Returns:
        true if the class is cf
      • isCFFile

        public static boolean isCFFile​(String fileName)
        Is the file a possible CF file.
        Parameters:
        fileName - the file name to check
        Returns:
        true if the file is a cf file, else false
      • isLucee

        public static boolean isLucee​(Object that)
        Are we a lucee page.
        Parameters:
        that - the object to check
        Returns:
        true if we are a lucee object
      • guessSource

        public static String guessSource​(String classname)
        When running on Lucee servers we can guess the source from the class name.
        Parameters:
        classname - the class we are processing
        Returns:
        the source file name, or null
      • loadCfTracepoints

        public static Set<TracePointConfig> loadCfTracepoints​(URL location,
                                                              Map<String,​TracePointConfig> values)
        Load the CF tracepoints based on the location url.
        Parameters:
        location - the location to look for
        values - the tracepoints to look at
        Returns:
        the set of tracepoints that match this location
      • loadCfTracepoints

        public static Set<TracePointConfig> loadCfTracepoints​(String location,
                                                              Map<String,​TracePointConfig> values)
        Load the CF tracepoints based on the location string.
        Parameters:
        location - the location to look for
        values - the tracepoints to look at
        Returns:
        the set of tracepoints that match this location