java.lang.Object
com.inductiveautomation.vision.api.client.components.model.CustomFunction

public class CustomFunction extends Object
  • Field Details

  • Constructor Details

    • CustomFunction

      public CustomFunction()
    • CustomFunction

      public CustomFunction(String script)
  • Method Details

    • parseName

      public static String parseName(String script)
    • parseParams

      public static List<String> parseParams(String script)
      Given an entire script, parse the params into a list of strings
    • parseParamsDirect

      public static List<String> parseParamsDirect(String parsedParams)
    • parseBody

      public static String parseBody(String script)
    • buildScriptHeader

      public static String buildScriptHeader(String name, List<String> paramList)
    • getScript

      public String getScript()
    • setScript

      public void setScript(String script)
    • getName

      public String getName()
    • setName

      public void setName(String name)
    • getParams

      public List<String> getParams()
    • setParams

      public void setParams(List<String> params)
    • get

      public static Map<String,String> get(JComponent component)
      Returns this component's map of function name -> script source.

      Note that this map is serialized on each component. See DefaultComponentDelegate

    • put

      public static void put(JComponent component, Map<String,String> functions)
    • getCache

      public static Map<String,org.python.core.PyMethod> getCache(JComponent component)
      Returns a map of the compiled PyMethods associated with this component's custom functions. If a function hasn't been called yet, in may not be in this cache.

      See PyComponentWrapper#customFunctionToPyMethod

    • clearCache

      public static void clearCache(JComponent component)
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hasMethodName

      public static boolean hasMethodName(JComponent component, String functionName)
      Returns true if the given component contains functionName in its Java class' method names.
    • hasCustomFunctions

      public static boolean hasCustomFunctions(JComponent component)