Java org.springframework.util ClassUtils fields, constructors, methods, implement or subclass

Example usage for Java org.springframework.util ClassUtils fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for org.springframework.util ClassUtils.

The text is from its open source code.

Subclass

org.springframework.util.ClassUtils has subclasses.
Click this link to see all its subclasses.

Field

StringARRAY_SUFFIX
Suffix for array class names: "[]" .
StringCLASS_FILE_SUFFIX
The ".class" file suffix.

Method

StringaddResourcePathToPackagePath(Class clazz, String resourceName)
Return a path suitable for use with ClassLoader.getResource (also suitable for use with Class.getResource by prepending a slash ('/') to the return value).
StringclassPackageAsResourcePath(@Nullable Class clazz)
Given an input class object, return a string which consists of the class's package name as a pathname, i.e., all dots ('.') are replaced by slashes ('/').
StringconvertClassNameToResourcePath(String className)
Convert a "."-based fully qualified class name to a "/"-based resource path.
StringconvertResourcePathToClassName(String resourcePath)
Convert a "/"-based resource path to a "."-based fully qualified class name.
ClasscreateCompositeInterface(Class[] interfaces, @Nullable ClassLoader classLoader)
Create a composite interface Class for the given interfaces, implementing the given interfaces in one single Class.
ClassdetermineCommonAncestor(@Nullable Class clazz1, @Nullable Class clazz2)
Determine the common ancestor of the given classes, if any.
ClassforName(String name, @Nullable ClassLoader classLoader)
Replacement for Class.forName() that also returns Class instances for primitives (e.g.
Class[]getAllInterfaces(Object instance)
Return all interfaces that the given instance implements as an array, including ones implemented by superclasses.
Set>getAllInterfacesAsSet(Object instance)
Return all interfaces that the given instance implements as a Set, including ones implemented by superclasses.
Class[]getAllInterfacesForClass(Class clazz)
Return all interfaces that the given class implements as an array, including ones implemented by superclasses.
Class[]getAllInterfacesForClass(Class clazz, @Nullable ClassLoader classLoader)
Return all interfaces that the given class implements as an array, including ones implemented by superclasses.
Set>getAllInterfacesForClassAsSet(Class clazz)
Return all interfaces that the given class implements as a Set, including ones implemented by superclasses.
Set>getAllInterfacesForClassAsSet(Class clazz, @Nullable ClassLoader classLoader)
Return all interfaces that the given class implements as a Set, including ones implemented by superclasses.
StringgetClassFileName(Class clazz)
Determine the name of the class file, relative to the containing package: e.g.
ConstructorgetConstructorIfAvailable(Class clazz, Class... paramTypes)
Determine whether the given class has a public constructor with the given signature, and return it if available (else return null ).
ClassLoadergetDefaultClassLoader()
Return the default ClassLoader to use: typically the thread context ClassLoader, if available; the ClassLoader that loaded the ClassUtils class will be used as fallback.
StringgetDescriptiveType(@Nullable Object value)
Return a descriptive name for the given object's type: usually simply the class name, but component type class name + "[]" for arrays, and an appended list of implemented interfaces for JDK proxies.
MethodgetMethod(Class clazz, String methodName, @Nullable Class... paramTypes)
Determine whether the given class has a public method with the given signature, and return it if available (else throws an IllegalStateException ).
MethodgetMethodIfAvailable(Class clazz, String methodName, @Nullable Class... paramTypes)
Determine whether the given class has a public method with the given signature, and return it if available (else return null ).
MethodgetMostSpecificMethod(Method method, @Nullable Class targetClass)
Given a method, which may come from an interface, and a target class used in the current reflective invocation, find the corresponding target method if there is one.
StringgetPackageName(Class clazz)
Determine the name of the package of the given class, e.g.
StringgetPackageName(String fqClassName)
Determine the name of the package of the given fully-qualified class name, e.g.
StringgetQualifiedMethodName(Method method)
Return the qualified name of the given method, consisting of fully qualified interface/class name + "."
StringgetQualifiedMethodName(Method method, @Nullable Class clazz)
Return the qualified name of the given method, consisting of fully qualified interface/class name + "."
StringgetQualifiedName(Class clazz)
Return the qualified name of the given class: usually simply the class name, but component type class name + "[]" for arrays.
StringgetShortName(String className)
Get the class name without the qualified package name.
StringgetShortName(Class clazz)
Get the class name without the qualified package name.
StringgetShortNameAsProperty(Class clazz)
Return the short string name of a Java class in uncapitalized JavaBeans property format.
MethodgetStaticMethod(Class clazz, String methodName, Class... args)
Return a public static method of a class.
ClassgetUserClass(Object instance)
Return the user-defined class for the given instance: usually simply the class of the given instance, but the original class in case of a CGLIB-generated subclass.
ClassgetUserClass(Class clazz)
Return the user-defined class for the given class: usually simply the given class, but the original class in case of a CGLIB-generated subclass.
booleanhasAtLeastOneMethodWithName(Class clazz, String methodName)
Does the given class or one of its superclasses at least have one or more methods with the supplied name (with any argument types)?
booleanhasConstructor(Class clazz, Class... paramTypes)
Determine whether the given class has a public constructor with the given signature.
booleanhasMethod(Class clazz, String methodName, Class... paramTypes)
Determine whether the given class has a public method with the given signature.
booleanisAssignable(Class lhsType, Class rhsType)
Check if the right-hand side type may be assigned to the left-hand side type, assuming setting by reflection.
booleanisAssignableValue(Class type, @Nullable Object value)
Determine if the given type is assignable from the given value, assuming setting by reflection.
booleanisCacheSafe(Class clazz, @Nullable ClassLoader classLoader)
Check whether the given class is cache-safe in the given context, i.e.
booleanisCglibProxy(Object object)
Check whether the given object is a CGLIB proxy.
booleanisCglibProxyClass(@Nullable Class clazz)
Check whether the specified class is a CGLIB-generated class.
booleanisJavaLanguageInterface(Class ifc)
Determine whether the given interface is a common Java language interface: Serializable , Externalizable , Closeable , AutoCloseable , Cloneable , Comparable - all of which can be ignored when looking for 'primary' user-level interfaces.
booleanisPresent(String className, @Nullable ClassLoader classLoader)
Determine whether the Class identified by the supplied name is present and can be loaded.
booleanisPrimitiveArray(Class clazz)
Check if the given class represents an array of primitives, i.e.
booleanisPrimitiveOrWrapper(Class clazz)
Check if the given class represents a primitive (i.e.
booleanisPrimitiveWrapperArray(Class clazz)
Check if the given class represents an array of primitive wrappers, i.e.
booleanisUserLevelMethod(Method method)
Determine whether the given method is declared by the user or at least pointing to a user-declared method.
booleanisVisible(Class clazz, @Nullable ClassLoader classLoader)
Check whether the given class is visible in the given ClassLoader.
ClassLoaderoverrideThreadContextClassLoader(@Nullable ClassLoader classLoaderToUse)
Override the thread context ClassLoader with the environment's bean ClassLoader if necessary, i.e.
ClassresolveClassName(String className, @Nullable ClassLoader classLoader)
Resolve the given class name into a Class instance.
ClassresolvePrimitiveIfNecessary(Class clazz)
Resolve the given class if it is a primitive class, returning the corresponding primitive wrapper type instead.
Class[]toClassArray(Collection> collection)
Copy the given Collection into a Class array.