Package com.softwaremining.platformutils
Class ClassUtility
java.lang.Object
com.softwaremining.platformutils.ClassUtility
Used Internally by SoftwareMining framework
Responsible for managing load of classes
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringconvertProgramCodeToFullClassName(String programCode, IBaseService owner) for internal use onlystatic StringconvertProgramCodeToFullClassName(String programCode, String newPackageName) static final StringformatClassName(String cobolName) static final Class<?>create load an instance of the classstatic final StringgetClassName(Class<?> c) removes the package name from the full path - e.g.static final ObjectgetInstance(String className, IBaseService baseService) create an instance of the class namestatic final ObjectgetInstance(String className, IBaseService baseService, boolean suppressException) create an instance of the class namestatic final StringgetPackageName(Class<?> c) removes the class name from the full path - e.g.
-
Field Details
-
log
-
-
Constructor Details
-
ClassUtility
public ClassUtility()
-
-
Method Details
-
getInstance
create an instance of the class name- Parameters:
className-classLoader-- Returns:
-
getInstance
public static final Object getInstance(String className, IBaseService baseService, boolean suppressException) create an instance of the class name- Parameters:
className-classLoader-- Returns:
-
getClass
create load an instance of the class- Parameters:
className-classLoader-- Returns:
- - null if no class is found. Throws RuntimeException if no class is found
-
getPackageName
removes the class name from the full path - e.g.
the class com.softwaremining.uitl.ClassUtility will return
com.softwaremining.uitl- Parameters:
c-- Returns:
-
getClassName
removes the package name from the full path - e.g.
the class com.softwaremining.util.MyClass will return MyClass- Parameters:
fully- existing class e.g. com.softwaremining.test.MyClass- Returns:
- - string representation of classname without package - e.g. MyClass
-
formatClassName
-
convertProgramCodeToFullClassName
for internal use only- Parameters:
programCode-owner-- Returns:
-
convertProgramCodeToFullClassName
-