com.jme.util.export.binary
Class BinaryClassLoader

java.lang.Object
  extended by com.jme.util.export.binary.BinaryClassLoader

public class BinaryClassLoader
extends java.lang.Object

Author:
mpowell

Constructor Summary
BinaryClassLoader()
           
 
Method Summary
static Savable fromName(java.lang.String className, InputCapsule inputCapsule)
          fromName creates a new Savable from the provided class name.
static void registerModule(BinaryLoaderModule m)
          registrrModule adds a module to the loader for handling special case class names.
static void unregisterModule(BinaryLoaderModule m)
          unregisterModule removes a module from the loader, no longer using it to handle special case class names.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinaryClassLoader

public BinaryClassLoader()
Method Detail

registerModule

public static void registerModule(BinaryLoaderModule m)
registrrModule adds a module to the loader for handling special case class names.

Parameters:
m - the module to register with this loader.

unregisterModule

public static void unregisterModule(BinaryLoaderModule m)
unregisterModule removes a module from the loader, no longer using it to handle special case class names.

Parameters:
m - the module to remove from the loader.

fromName

public static Savable fromName(java.lang.String className,
                               InputCapsule inputCapsule)
                        throws java.lang.InstantiationException,
                               java.lang.IllegalAccessException,
                               java.lang.ClassNotFoundException,
                               java.io.IOException
fromName creates a new Savable from the provided class name. First registered modules are checked to handle special cases, if the modules do not handle the class name, the class is instantiated directly.

Parameters:
className - the class name to create.
inputCapsule - the InputCapsule that will be used for loading the Savable (to look up ctor parameters)
Returns:
the Savable instance of the class.
Throws:
java.lang.InstantiationException - thrown if the class does not have an empty constructor.
java.lang.IllegalAccessException - thrown if the class is not accessable.
java.lang.ClassNotFoundException - thrown if the class name is not in the classpath.
java.io.IOException - when loading ctor parameters fails