|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.ClassLoader
net.sf.fikin.classmarshaling.util.HidingClassLoader
public class HidingClassLoader
Class loader "hiding" any class part of given list of hierarchies.
This is useful in cases when it is required an "artificial" environment
where given classes are assumed not to be present.
I use it in testing and initial implementation stages of my applications. created on Aug 5, 2005
Constructor Summary | |
---|---|
HidingClassLoader(java.lang.ClassLoader parent)
construct hiding classloader with given parent |
|
HidingClassLoader(java.lang.ClassLoader parent,
java.util.Collection prefixes)
construct hiding classloader with given parent and list of prefixes |
|
HidingClassLoader(java.lang.ClassLoader parent,
java.lang.String[] prefixes)
construct hiding classloader with given parent and list of prefixes |
Method Summary | |
---|---|
protected java.lang.Class |
loadClass(java.lang.String name,
boolean resolve)
class lookup call. |
void |
setPrefixes(java.util.Collection prefixes)
assign list of class hierarchies which are to be hided by this classloader |
void |
setPrefixes(java.lang.String[] prefixes)
assign list of class hierarchies which are to be hided by this classloader |
Methods inherited from class java.lang.ClassLoader |
---|
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HidingClassLoader(java.lang.ClassLoader parent)
parent
- classloaderpublic HidingClassLoader(java.lang.ClassLoader parent, java.util.Collection prefixes)
parent
- classloaderprefixes
- of classes to hidepublic HidingClassLoader(java.lang.ClassLoader parent, java.lang.String[] prefixes)
parent
- classloaderprefixes
- of classes to hideMethod Detail |
---|
public void setPrefixes(java.util.Collection prefixes)
prefixes
- public void setPrefixes(java.lang.String[] prefixes)
prefixes
- protected java.lang.Class loadClass(java.lang.String name, boolean resolve) throws java.lang.ClassNotFoundException
if asked class is part of one the specified prefix hierarchies it will throw ClassNotFoundException exception.
All other classes are propagated to its parent classloader.
loadClass
in class java.lang.ClassLoader
name
- of the class to checkresolve
- the class
Class
object
java.lang.ClassNotFoundException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |