jess
Class ClassSource

java.lang.Object
  extended byjess.ClassSource
All Implemented Interfaces:
java.io.Serializable

public class ClassSource
extends java.lang.Object
implements java.io.Serializable

Loads user classes and resources. Jess uses this to manage "import" function calls and to cache loaded class objects.

(C) 2005 Sandia National Laboratories

See Also:
Serialized Form

Method Summary
static java.lang.String classNameOnly(java.lang.String name)
           
 void clear()
           
 java.lang.Class findClass(java.lang.String className)
           
 java.applet.Applet getApplet()
          Returns the applet this Rete is installed in.
 java.lang.Class getAppObjectClass()
          Returns the "application object" for this Rete instance
 java.lang.ClassLoader getClassLoader()
           
 java.net.URL getResource(java.lang.String name)
           
 void importClass(java.lang.String clazz)
           
 void importPackage(java.lang.String pack)
           
 void setApplet(java.applet.Applet applet)
          Associates this Rete with an applet so that, for instance, the (batch) commands will look for scripts using the applet's document base URL.
 void setAppObject(java.lang.Object appObject)
          Associates this Rete with an object so that, for instance, the (batch) commands will look for scripts using the object's class loader.
 void setClassLoader(java.lang.ClassLoader loader)
          Associates this Rete with a specific class loader; the loader will be used to find batch files and load classes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getApplet

public java.applet.Applet getApplet()
Returns the applet this Rete is installed in. Returns null if none.

Returns:
The applet

getAppObjectClass

public java.lang.Class getAppObjectClass()
Returns the "application object" for this Rete instance

See Also:
Rete.Rete(java.lang.Object)

setApplet

public void setApplet(java.applet.Applet applet)
Associates this Rete with an applet so that, for instance, the (batch) commands will look for scripts using the applet's document base URL.

Parameters:
applet - The applet

setAppObject

public void setAppObject(java.lang.Object appObject)
Associates this Rete with an object so that, for instance, the (batch) commands will look for scripts using the object's class loader.

Parameters:
appObject - The app object

setClassLoader

public void setClassLoader(java.lang.ClassLoader loader)
Associates this Rete with a specific class loader; the loader will be used to find batch files and load classes.

Parameters:
loader - The class loader

findClass

public java.lang.Class findClass(java.lang.String className)
                          throws java.lang.ClassNotFoundException
Throws:
java.lang.ClassNotFoundException

getResource

public java.net.URL getResource(java.lang.String name)

importPackage

public void importPackage(java.lang.String pack)

importClass

public void importClass(java.lang.String clazz)
                 throws JessException
Throws:
JessException

clear

public void clear()

getClassLoader

public java.lang.ClassLoader getClassLoader()

classNameOnly

public static java.lang.String classNameOnly(java.lang.String name)

© 2006 Sandia Corporation