|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gate.util.Jdk
Jdk encapsulates some utilities for poking around in your Java environment.
Constructor Summary | |
Jdk()
Anonymous construction. |
Method Summary | |
byte[] |
compile(String javaCode,
String className)
Compile a class from its source code string. |
Class |
defineClass(String classQualifiedName,
byte[] classBytes)
Define a class from its qualified name and the byte array of its binary. |
File |
getToolsHome()
Returns a File specifying the location of the JDK tools, i.e. |
Object |
instantiateClass(Class theClass)
Create an instance of a class. |
Class |
loadActionClass(String classFileName)
Load a class. |
static void |
main(String[] args)
main. |
byte[] |
readClass(String classFileName)
Read the bytes for a class. |
void |
testMe()
Test method. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Jdk()
Method Detail |
public static void main(String[] args) throws GateException
GateException
public void testMe() throws GateException
GateException
public File getToolsHome() throws GateException
java, javac, jar
. It
assumes that if it finds javac
or javac.exe
then it found the tools home.
GateException
public byte[] compile(String javaCode, String className) throws GateException
className
- should have the package path to the source, e.g.
com/thing/MyClass.java.
GateException
public byte[] readClass(String classFileName) throws GateException
classFileName
- should have the path to the .class
file, e.g. com/thing/MyClass.class.
GateException
public Class loadActionClass(String classFileName) throws GateException
classFileName
- is the path to the .class
file, e.g. com/thing/MyClass.class.
GateException
public Class defineClass(String classQualifiedName, byte[] classBytes) throws GateException
GateException
public Object instantiateClass(Class theClass) throws GateException
GateException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |