Class ClassData

java.lang.Object
com.inductiveautomation.snap.filedata.SnapData
com.inductiveautomation.snap.filedata.ClassData
All Implemented Interfaces:
WebSite.Servlet

public class ClassData extends SnapData implements WebSite.Servlet
A file to represent a Java class.
  • Constructor Details

    • ClassData

      public ClassData()
  • Method Details

    • getClassName

      public String getClassName()
      Returns the class name.
    • getClassNameTop

      public String getClassNameTop()
      Returns the top class name.
    • getPackageName

      public String getPackageName()
      Returns the package name.
    • getJavaFile

      public WebFile getJavaFile()
      Returns the JavaFile for this class, if it can be found.
    • getCompiledClass

      public Class getCompiledClass()
      Returns the class compiled from this java file.
    • getInstance

      public Object getInstance()
      Returns a new instance of the compiled class of this java file.
    • getInstance

      public <T> T getInstance(Class<T> aClass)
      Returns a new instance of the compiled class of this java file as requested class, if applicable.
    • getInstanceURL

      public WebURL getInstanceURL(Object anObj)
      Returns a URL for given instance.
    • getURLInstance

      @Nullable public Object getURLInstance(WebURL aURL)
      Returns an instance for given id.
    • handleGet

      @Nonnull public Response handleGet(@Nonnull Request aRequest)
      Returns a query file for given query.
      Specified by:
      handleGet in interface WebSite.Servlet
    • getDependencies

      public String[] getDependencies()
      Returns the list of class names that this class file is dependent on.
    • getHasMain

      public boolean getHasMain()
      Returns whether class file has main method.
    • runMain

      public void runMain()
      Runs the main method of compiled class.
    • get

      public static ClassData get(WebFile aFile)
      Returns the ClassData for given file.