Package com.google.common.reflect
Class Reflection
java.lang.Object
com.google.common.reflect.Reflection
Deprecated.
The Google Guava Core Libraries are deprecated and will not be part of the AEM SDK after April 2023
Static utilities relating to Java reflection.
- Since:
- 12.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetPackageName(Class<?> clazz) Deprecated.Returns the package name ofclazzaccording to the Java Language Specification (section 6.7).static StringgetPackageName(String classFullName) Deprecated.Returns the package name ofclassFullNameaccording to the Java Language Specification (section 6.7).static voidinitialize(Class<?>... classes) Deprecated.Ensures that the given classes are initialized, as described in JLS Section 12.4.2.static <T> TnewProxy(Class<T> interfaceType, InvocationHandler handler) Deprecated.Returns a proxy instance that implementsinterfaceTypeby dispatching method invocations tohandler.
-
Method Details
-
getPackageName
Deprecated.Returns the package name ofclazzaccording to the Java Language Specification (section 6.7). UnlikeClass.getPackage(), this method only parses the class name, without attempting to define thePackageand hence load files. -
getPackageName
Deprecated.Returns the package name ofclassFullNameaccording to the Java Language Specification (section 6.7). UnlikeClass.getPackage(), this method only parses the class name, without attempting to define thePackageand hence load files. -
initialize
Deprecated.Ensures that the given classes are initialized, as described in JLS Section 12.4.2.WARNING: Normally it's a smell if a class needs to be explicitly initialized, because static state hurts system maintainability and testability. In cases when you have no choice while inter-operating with a legacy framework, this method helps to keep the code less ugly.
- Throws:
ExceptionInInitializerError- if an exception is thrown during initialization of a class
-
newProxy
Deprecated.Returns a proxy instance that implementsinterfaceTypeby dispatching method invocations tohandler. The class loader ofinterfaceTypewill be used to define the proxy class. To implement multiple interfaces or specify a class loader, useProxy.newProxyInstance(java.lang.ClassLoader, java.lang.Class<?>[], java.lang.reflect.InvocationHandler).- Throws:
IllegalArgumentException- ifinterfaceTypedoes not specify the type of a Java interface
-