public class Introspection extends Object
IDecisionMethod, IDecisionRule, and
IDecisionCategory in all .jar files in a user defined
directory.| Modifier and Type | Field and Description |
|---|---|
protected static String[] |
defaultLocation |
protected static ToxTreeClassLoader |
loader |
protected static Logger |
logger |
static String |
TOXTREE_HOME |
| Modifier | Constructor and Description |
|---|---|
protected |
Introspection() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addDirectory(String dirName) |
static void |
configureURLLoader(ClassLoader classLoader)
Adds URLS of jars in default directories to the class loader.
|
static void |
configureURLLoader(File directory)
Adds URLS of jars in specified directory to the class loader.
|
static void |
configureURLLoader(File[] jars)
Adds URLS of jars specified in File[] to the class loader.
|
static Object |
createObject(String className)
Creates object given the class name
|
static File[] |
enumerateJars(File directory) |
static ToxTreePackageEntries |
getAvailableCategoryTypes(ClassLoader classLoader)
Returns a list with available categories
|
static ToxTreePackageEntries |
getAvailableRuleTypes(ClassLoader classLoader)
Returns a list with available rule names.
|
static ToxTreePackageEntries |
getAvailableTreeTypes(ClassLoader classLoader)
Returns a list with available decision trees.
|
static ToxTreePackageEntries |
getAvailableTypes(ClassLoader classLoader,
String interfacename)
This method is the core of
ToxTreeApp extension
mechanism. |
static String[] |
getDefaultDirectories() |
static ClassLoader |
getLoader() |
static String |
getToxTreeRoot() |
static ToxTreePackageEntries |
implementInterface(ClassLoader classLoader,
File directory,
String interfaceName)
Finds classes implementing an interface in all .jar files in a user
defined directory.
|
static Class |
implementsInterface(Class clazz,
String interfaceName)
Verifies if a class implements an interface
|
static Class |
implementsInterface(String className,
String interfaceName)
Verifies if a class implements an interface
|
static void |
listBaseTypes(Class cls,
String prefix)
this is just a test for the concept of introspection
|
static Object |
loadCreateObject(String className) |
static IDecisionMethodsList |
loadForest(InputStream stream) |
static IDecisionMethodsList |
loadForestXML(InputStream stream) |
static IDecisionMethod |
loadRules(InputStream stream,
String newTitle)
Loads a decision tree from an InputStream Uses Java serialization
mechanism
|
static IDecisionMethod |
loadRulesXML(InputStream stream,
String newTitle) |
static void |
saveRulesXML(IDecisionMethod method,
OutputStream out) |
static void |
setLoader(ClassLoader classLoader) |
public static final String TOXTREE_HOME
protected static String[] defaultLocation
protected static transient Logger logger
protected static ToxTreeClassLoader loader
public static void addDirectory(String dirName)
public static String[] getDefaultDirectories()
public static void listBaseTypes(Class cls, String prefix)
public static Class implementsInterface(String className, String interfaceName) throws IntrospectionException
className - - the name of the class to be verifiedinterfaceName - - the name of the interface to be searched forIntrospectionExceptionpublic static Class implementsInterface(Class clazz, String interfaceName)
clazz - - the class to be verifiedinterfaceName - - the name of the interface to be searched forpublic static File[] enumerateJars(File directory) throws IntrospectionException
IntrospectionExceptionpublic static void configureURLLoader(ClassLoader classLoader)
configureURLLoader(File directory) for each of
defaultLocation directories.classLoader - public static void configureURLLoader(File directory) throws IntrospectionException
directory - IntrospectionExceptionpublic static void configureURLLoader(File[] jars) throws IntrospectionException
jars - IntrospectionExceptionpublic static ToxTreePackageEntries implementInterface(ClassLoader classLoader, File directory, String interfaceName) throws IntrospectionException
directory - - the directory with jar files to be searched forinterfaceName - - the name of the interface to be searched forIntrospectionExceptionpublic static ToxTreePackageEntries getAvailableRuleTypes(ClassLoader classLoader)
getAvailableTypes(ClassLoader, String)ArrayList of class names that implement
IDecisionRulepublic static ToxTreePackageEntries getAvailableTreeTypes(ClassLoader classLoader)
getAvailableTypes(ClassLoader, String)ArrayList of class names that implement
IDecisionMethodpublic static ToxTreePackageEntries getAvailableTypes(ClassLoader classLoader, String interfacename)
ToxTreeApp extension
mechanism. Looks for classes that implement interface given by
interfacename parameter. Returns a list with class names. Jar files
within the following directories are analyzed:
classLoader - interfacename - theArrayListpublic static ToxTreePackageEntries getAvailableCategoryTypes(ClassLoader classLoader)
ArrayList of class names that implement
IDecisionCategorypublic static Object createObject(String className)
className - public static Object loadCreateObject(String className) throws InstantiationException, IllegalAccessException, ClassNotFoundException
public static ClassLoader getLoader()
public static void setLoader(ClassLoader classLoader)
public static IDecisionMethod loadRules(InputStream stream, String newTitle) throws IntrospectionException
stream - newTitle - IDecisionMethodIntrospectionExceptionpublic static IDecisionMethodsList loadForest(InputStream stream) throws IntrospectionException
IntrospectionExceptionpublic static void saveRulesXML(IDecisionMethod method, OutputStream out) throws IntrospectionException
IntrospectionExceptionpublic static IDecisionMethod loadRulesXML(InputStream stream, String newTitle) throws IntrospectionException
IntrospectionExceptionpublic static IDecisionMethodsList loadForestXML(InputStream stream) throws IntrospectionException
IntrospectionExceptionpublic static String getToxTreeRoot()
Copyright © 2004–2018 Ideaconsult Ltd. All rights reserved.