ClassExtensions@Deprecated public final class ClassUtils extends Object
Class.| Modifier and Type | Field and Description |
|---|---|
protected static org.apache.log4j.Logger |
LOGGER
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
equalsByClassName(Class<?> oneClass,
Class<?> otherClass)
Deprecated.
Equal the given class objects by they qualified class names.
|
static Class<?> |
forName(String className)
Deprecated.
Look up the class in the "current" ClassLoader.
|
static Class<?> |
getBaseClass(Class<?> childClass)
Deprecated.
Gets the parent base class from the given child class.
|
static ClassLoader |
getClassLoader()
Deprecated.
Gets the current class loader.
|
static ClassLoader |
getClassLoader(Object obj)
Deprecated.
Gets the ClassLoader from the given object.
|
static String |
getClassnameWithSuffix(Class<?> clazz)
Deprecated.
Gets the classname and concats the suffix ".class" from the class.
|
static String |
getClassnameWithSuffix(Object obj)
Deprecated.
Gets the classname and concats the suffix ".class" from the object.
|
static List<File> |
getDirectoriesFromResources(String path,
boolean isPackage)
Deprecated.
Gets the directories from the given path.
|
static String |
getManifestUrl(Class<?> clazz)
Deprecated.
If the given class is in a JAR, WAR or EAR file than the manifest url as String is returned.
|
static String |
getName(Class<?> clazz)
Deprecated.
Returns the name of the given class or null if the given class is null.
|
static String |
getName(Class<?> clazz,
boolean simple)
Deprecated.
Returns the name of the given class or null if the given class is null.
|
static String |
getPath(Class<?> clazz)
Deprecated.
Gets the path from the given class.
|
static String |
getPathFromObject(Object obj)
Deprecated.
Finds the absolute path from the object.
|
static URL |
getResource(Class<?> clazz,
String path)
Deprecated.
Gives the url from the path back.
|
static URL |
getResource(String name)
Deprecated.
Gives the URL from the resource.
|
static <T> URL |
getResource(String name,
T obj)
Deprecated.
Gives the URL from the resource.
|
static File |
getResourceAsFile(String name)
Deprecated.
Gives the resource as a file Object.
|
static File |
getResourceAsFile(String name,
Object obj)
Deprecated.
Gives the resource as a file Object.
|
static InputStream |
getResourceAsStream(Class<?> clazz,
String uri)
Deprecated.
This method call the getResourceAsStream from the ClassLoader.
|
static InputStream |
getResourceAsStream(String name)
Deprecated.
Gives the Inputstream from the resource.
|
static InputStream |
getResourceAsStream(String name,
Object obj)
Deprecated.
Gives the Inputstream from the resource.
|
static List<URL> |
getResources(String path)
Deprecated.
Gets a list with urls from the given path for all resources.
|
static String |
getSimpleName(Class<?> clazz)
Deprecated.
Returns the simple name of the given class or null if the given class is null.
|
static URL |
getURL(Class<?> clazz)
Deprecated.
Returns the URL from the given class.
|
static boolean |
isDerivate(ClassLoader source,
ClassLoader compare)
Deprecated.
Compares the two given ClassLoader objects and returns true if compare is a derivate of
source.
|
static String |
normalizeQualifiedClassName(String qualifiedClassname)
Deprecated.
Normalizes the given full qualified class name.
|
static String |
normalizeSimpleClassName(String className)
Deprecated.
Normalizes the given simple class name.
|
static Set<Class<?>> |
scanClassesFromPackage(File directory,
String packagePath)
Deprecated.
Scan for classes in the given directory.
|
static Set<Class<?>> |
scanClassesFromPackage(File directory,
String packagePath,
boolean recursive)
Deprecated.
Scan recursive for classes in the given directory.
|
static Set<Class<?>> |
scanClassNames(String packageName)
Deprecated.
Scan class names from the given package name.
|
static Set<Class<?>> |
scanClassNames(String packageName,
boolean recursive)
Deprecated.
Scan class names from the given package name.
|
public static boolean equalsByClassName(Class<?> oneClass, Class<?> otherClass)
oneClass - one class for equation by the qualified class name.otherClass - the other class for equation by the qualified class name.public static Class<?> forName(String className) throws ClassNotFoundException
className - The class name to loadClassNotFoundException - if the Class was not found.public static Class<?> getBaseClass(Class<?> childClass)
childClass - the child classpublic static ClassLoader getClassLoader()
public static ClassLoader getClassLoader(Object obj)
obj - The object.public static String getClassnameWithSuffix(Class<?> clazz)
clazz - The class.public static String getClassnameWithSuffix(Object obj)
obj - The object.public static List<File> getDirectoriesFromResources(String path, boolean isPackage) throws IOException
path - the pathisPackage - If the Flag is true than the given path is a package.IOException - Signals that an I/O exception has occurred.public static String getManifestUrl(Class<?> clazz)
clazz - The class.public static String getName(Class<?> clazz)
clazz - The class.public static String getName(Class<?> clazz, boolean simple)
clazz - The classsimple - The flag if the simple name should be returned.public static String getPath(Class<?> clazz)
Objectclazz - The class.public static String getPathFromObject(Object obj)
obj - The object.public static URL getResource(Class<?> clazz, String path)
clazz - The class-object.path - The path.public static URL getResource(String name)
name - The name from the resource.public static <T> URL getResource(String name, T obj)
T - the generic typename - The name from the resource.obj - The Object.public static File getResourceAsFile(String name) throws URISyntaxException
name - The name from the file.URISyntaxException - occurs by creation of the file with an uri.public static File getResourceAsFile(String name, Object obj) throws URISyntaxException
name - The name from the file.obj - The Object.URISyntaxException - occurs by creation of the file with an uri.public static InputStream getResourceAsStream(Class<?> clazz, String uri)
clazz - the clazzuri - The uri as String.public static InputStream getResourceAsStream(String name)
name - The name from the resource.public static InputStream getResourceAsStream(String name, Object obj)
name - The name from the resource.obj - The Object.public static List<URL> getResources(String path) throws IOException
path - The base path.IOException - Signals that an I/O exception has occurred.public static String getSimpleName(Class<?> clazz)
clazz - The class.public static URL getURL(Class<?> clazz)
clazz - The class.public static boolean isDerivate(ClassLoader source, ClassLoader compare)
source - the sourcecompare - the comparepublic static String normalizeQualifiedClassName(String qualifiedClassname)
qualifiedClassname - the full qualified class name to normalize.public static String normalizeSimpleClassName(String className)
className - the class name to normalize.public static Set<Class<?>> scanClassesFromPackage(File directory, String packagePath) throws ClassNotFoundException
directory - the directorypackagePath - the package pathClassNotFoundException - the class not found exceptionpublic static Set<Class<?>> scanClassesFromPackage(File directory, String packagePath, boolean recursive) throws ClassNotFoundException
directory - the directorypackagePath - the package pathrecursive - the recursiveClassNotFoundException - is thrown if a class in the given path cannot be located.public static Set<Class<?>> scanClassNames(String packageName) throws IOException, ClassNotFoundException
packageName - the package nameIOException - Signals that an I/O exception has occurred.ClassNotFoundException - is thrown if a class in the given path cannot be located.public static Set<Class<?>> scanClassNames(String packageName, boolean recursive) throws IOException, ClassNotFoundException
packageName - the package namerecursive - the recursive flagIOException - Signals that an I/O exception has occurred.ClassNotFoundException - is thrown if a class in the given path cannot be located.Copyright © 2007–2015 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.