Package com.jme3.export
Class SavableClassUtil
java.lang.Object
com.jme3.export.SavableClassUtil
SavableClassUtil contains various utilities to handle
Savable classes. The methods are general enough to not be specific to any
particular implementation.
Currently it will remap any classes from old paths to new paths
so that old J3O models can still be loaded.-
Method Summary
Modifier and TypeMethodDescriptionstatic SavablefromName creates a new Savable from the provided class name.static SavablefromName(String className, List<ClassLoader> loaders) static intgetSavableVersion(Class<? extends Savable> clazz) static int[]getSavableVersions(Class<? extends Savable> clazz) static intgetSavedSavableVersion(Object savable, Class<? extends Savable> desiredClass, int[] versions, int formatVersion) static booleanisImplementingSavable(Class clazz)
-
Method Details
-
isImplementingSavable
-
getSavableVersions
- Throws:
IOException
-
getSavableVersion
- Throws:
IOException
-
getSavedSavableVersion
-
fromName
public static Savable fromName(String className) throws ClassNotFoundException, IllegalAccessException, InstantiationException, InvocationTargetException 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.- Returns:
- the Savable instance of the class.
- Throws:
InstantiationException- thrown if the class does not have an empty constructor.IllegalAccessException- thrown if the class is not accessible.InvocationTargetException- if the underlying constructor throws an exceptionClassNotFoundException- thrown if the class name is not in the classpath.
-
fromName
public static Savable fromName(String className, List<ClassLoader> loaders) throws InstantiationException, InvocationTargetException, NoSuchMethodException, IllegalAccessException, ClassNotFoundException, IOException
-