Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.batik.script.rhino
Class RhinoClassLoader

    java.lang.Object
      java.lang.ClassLoader
          java.security.SecureClassLoader
              java.net.URLClassLoader
                  org.apache.batik.script.rhino.RhinoClassLoader

All Implemented Interfaces:
  GeneratedClassLoader

    public class RhinoClassLoader

extends URLClassLoader
implements GeneratedClassLoader

This class loader implementation will work whether or not the documentURL is null.

Field Summary
`protected CodeSource` | `codeSource` CodeSource for classes defined by this loader
`protected URL` | `documentURL` URL for the document referencing the script.
`protected AccessControlContext` | `rhinoAccessControlContext` The AccessControlContext which can be associated with code loaded by this class loader if it was running stand-alone (i.e., not invoked by code with lesser priviledges).

Constructor Summary
`RhinoClassLoader(URL documentURL, ClassLoader parent)` Constructor.

Method Summary
`Class` | `defineClass(String name, byte[] data)` Define and load a Java class
`AccessControlContext` | `getAccessControlContext()` Returns the AccessControlContext which should be associated with RhinoCode.
`protected PermissionCollection` | `getPermissions(CodeSource codesource)` Returns the permissions for the given CodeSource object.
`void` | `linkClass(Class clazz)` Links the Java class.

Methods inherited from class java.net.URLClassLoader
`addURL, definePackage, findClass, findResource, findResources, getURLs, newInstance, newInstance`

Methods inherited from class java.security.SecureClassLoader
`defineClass, defineClass`

Methods inherited from class java.lang.ClassLoader
`clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### documentURL

    protected URL documentURL

  URL for the document referencing the script.

### codeSource

    protected CodeSource codeSource

  CodeSource for classes defined by this loader

### rhinoAccessControlContext

    protected AccessControlContext rhinoAccessControlContext

  The AccessControlContext which can be associated with code loaded by this class loader if it was running stand-alone (i.e., not invoked by code with lesser priviledges).

Constructor Detail

### RhinoClassLoader

    public RhinoClassLoader(URL documentURL,
                            ClassLoader parent)

  Constructor.

  Parameters:
    `documentURL` - the URL from which to load classes and resources
    `parent` - the parent class loader for delegation

Method Detail

### defineClass

    public Class defineClass(String name,
                             byte[] data)

  Define and load a Java class

  Specified by:
    `defineClass` in interface `GeneratedClassLoader`

### linkClass

    public void linkClass(Class clazz)

  Links the Java class.

  Specified by:
    `linkClass` in interface `GeneratedClassLoader`

### getAccessControlContext

    public AccessControlContext getAccessControlContext()

  Returns the AccessControlContext which should be associated with RhinoCode.

### getPermissions

    protected PermissionCollection getPermissions(CodeSource codesource)

  Returns the permissions for the given CodeSource object. Compared to URLClassLoader, this adds a FilePermission so that files under the same root directory as the document can be read.

  Overrides:
    `getPermissions` in class `URLClassLoader`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2008 Apache Software Foundation. All Rights Reserved.