| java.net.URLClassLoader org.jibx.binding.Loader
Loader | public class Loader extends URLClassLoader (Code) | | Binding classloader. This is intended to substitute for the System
classloader (i.e., the one used for loading user classes). It first processes
one or more binding definitions, caching the binary classes modified by the
bindings. It then uses these modified forms of the classes when they're
requested for loading.
author: Dennis M. Sosnoski version: 1.0 |
Inner Class :public static class NondelegatingLoader extends Loader | |
Constructor Summary | |
public | Loader(URL[] paths, ClassLoader parent) Constructor with classpath URLs and parent classloader supplied. | public | Loader(URL[] paths) Constructor with classpath URLs supplied. | public | Loader() Default constructor. |
Loader | public Loader(URL[] paths, ClassLoader parent)(Code) | | Constructor with classpath URLs and parent classloader supplied. Sets up
the paths for both actual classloading and finding classes to be bound.
Parameters: paths - array of classpath URLs Parameters: parent - classloader used for delegation loading |
Loader | public Loader(URL[] paths)(Code) | | Constructor with classpath URLs supplied. This uses the supplied
classpaths, delegating directly to the parent classloader of the normal
System classloader.
Parameters: paths - array of classpath URLs |
Loader | public Loader() throws MalformedURLException(Code) | | Default constructor. This reads the standard class path and uses it for
locating classes used by the binding, delegating directly to the parent
classloader of the normal System classloader.
exception: MalformedURLException - on error in classpath URLs |
findClass | protected Class findClass(String name) throws ClassNotFoundException(Code) | | Find and load class by name. If the named class has been modified by a
binding this loads the modified binary class; otherwise, it just uses the
base class implementation to do the loading. If bindings haven't been
compiled prior to this call they will be compiled automatically when this
method is called.
See Also: java.lang.ClassLoader.findClass(java.lang.String) Parameters: name - fully qualified package and class name to be found the loaded class throws: ClassNotFoundException - if the class cannot be found |
getClassPaths | public static URL[] getClassPaths() throws MalformedURLException(Code) | | Method builds an array of URL for items in the class path.
array of classpath URLs |
isBoundClass | protected boolean isBoundClass(String name)(Code) | | Check if a class has been modified by a binding. If bindings haven't been
compiled prior to this call they will be compiled automatically when this
method is called.
Parameters: name - fully qualified package and class name to be found true if class modified by binding,false if not |
loadBinding | public void loadBinding(String fname, String sname, InputStream is, URL url) throws JiBXException, IOException(Code) | | Load binding definition. This may be called multiple times to load
multiple bindings, but only prior to the bindings being compiled. The
reader form of the call is generally preferred, since the document
encoding may not be properly interpreted from a stream.
Parameters: fname - binding definition full name Parameters: sname - short form of name to use as the default name of the binding Parameters: is - input stream for binding definition document Parameters: url - URL for binding definition (null if notavailable) exception: IllegalStateException - if called after bindings have beencompiled exception: IOException - if error reading the binding exception: JiBXException - if error in processing the binding definition |
loadFileBinding | public void loadFileBinding(String path) throws JiBXException, IOException(Code) | | Load binding definition from file path. This may be called multiple times
to load multiple bindings, but only prior to the bindings being compiled.
Parameters: path - binding definition file path exception: IllegalStateException - if called after bindings have beencompiled exception: IOException - if error reading the file exception: JiBXException - if error in processing the binding definition |
loadResourceBinding | public void loadResourceBinding(String path) throws JiBXException, IOException(Code) | | Load binding definition from file path. This may be called multiple times
to load multiple bindings, but only prior to the bindings being compiled.
Parameters: path - binding definition file path exception: IllegalStateException - if called after bindings have beencompiled exception: IOException - if error reading the file exception: JiBXException - if error in processing the binding definition |
processBindings | public void processBindings() throws JiBXException(Code) | | Process the binding definitions. This compiles the bindings into the
classes, saving the modified classes for loading when needed.
exception: JiBXException - if error in processing the binding definition |
reset | public void reset()(Code) | | Reset loader information. This discards all prior bindings and clears the
internal state in preparation for loading a different set of bindings. It
is not possible to clear the loaded classes, though, so any new bindings
must refer to different classes from those previously loaded.
|
|
|