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 Summary
Constructors Constructor Description ClassData()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ClassData
get(WebFile aFile)
Returns the ClassData for given file.java.lang.String
getClassName()
Returns the class name.java.lang.String
getClassNameTop()
Returns the top class name.java.lang.Class
getCompiledClass()
Returns the class compiled from this java file.java.lang.String[]
getDependencies()
Returns the list of class names that this class file is dependent on.boolean
getHasMain()
Returns whether class file has main method.java.lang.Object
getInstance()
Returns a new instance of the compiled class of this java file.<T> T
getInstance(java.lang.Class<T> aClass)
Returns a new instance of the compiled class of this java file as requested class, if applicable.WebURL
getInstanceURL(java.lang.Object anObj)
Returns a URL for given instance.WebFile
getJavaFile()
Returns the JavaFile for this class, if it can be found.java.lang.String
getPackageName()
Returns the package name.java.lang.Object
getURLInstance(WebURL aURL)
Returns an instance for given id.Response
handleGet(Request aRequest)
Returns a query file for given query.void
runMain()
Runs the main method of compiled class.-
Methods inherited from class com.inductiveautomation.snap.filedata.SnapData
createBytes, createSourceURL, delete, get, getBytes, getInputStream, getSite, getSource, getSourceFile, getSourceURL, is, refresh, save, setBytes, setSource
-
-
-
-
Method Detail
-
getClassName
public java.lang.String getClassName()
Returns the class name.
-
getClassNameTop
public java.lang.String getClassNameTop()
Returns the top class name.
-
getPackageName
public java.lang.String getPackageName()
Returns the package name.
-
getJavaFile
public WebFile getJavaFile()
Returns the JavaFile for this class, if it can be found.
-
getCompiledClass
public java.lang.Class getCompiledClass()
Returns the class compiled from this java file.
-
getInstance
public java.lang.Object getInstance()
Returns a new instance of the compiled class of this java file.
-
getInstance
public <T> T getInstance(java.lang.Class<T> aClass)
Returns a new instance of the compiled class of this java file as requested class, if applicable.
-
getInstanceURL
public WebURL getInstanceURL(java.lang.Object anObj)
Returns a URL for given instance.
-
getURLInstance
@Nullable public java.lang.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 interfaceWebSite.Servlet
-
getDependencies
public java.lang.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.
-
-