Package com.google.inject.internal.aop
Class ClassBuilding
java.lang.Object
com.google.inject.internal.aop.ClassBuilding
Entry-point for building enhanced classes and 'fast-class' invocation.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BytecodeGen.EnhancerBuilderbuildEnhancerBuilder(Class<?> hostClass) Builder of enhancers that provide method interception via bytecode generation.buildFastClass(Class<?> hostClass) Builds a 'fast-class' invoker that uses bytecode generation in place of reflection.private static booleancanAccess(Executable member, boolean samePackage) Can we access this member from a subclass which may be in the same package?static booleancanEnhance(Executable member) Returns true if the given member can be enhanced using bytecode.static booleancanFastInvoke(Executable member) Returns true if the given member can be fast-invoked.private static Method[]Cache common overridable Object methods.private static booleanprivate static booleanmergeInterface(List<Class<?>> interfaces, Class<?> candidate) Attempts to merge the interface with the current flattened hierarchy.private static ObjectmergeMethods(Object existing, Object added) Add the new method to an existing partition or create a new one.private static StringpackageName(String className) Extract the package name from a class name.private static voidpartitionMethod(Method method, Map<String, Object> partitions) Methods are partitioned by name and parameter count.private static voidpushInterfaces(Deque<Class<?>[]> interfaceStack, Class<?>[] interfaces) Pushes the interface declaration onto the stack if it's not empty.static Stringsignature(Constructor<?> constructor) Minimum signature needed to disambiguate constructors from the same host class.static StringMinimum signature needed to disambiguate methods from the same host class.private static StringAppends a semicolon-separated list of parameter types to the given name.private static voidvisitFastConstructors(Class<?> hostClass, Consumer<Constructor<?>> visitor) Visit all constructors for the host class that can be fast-invoked.private static voidvisitFastMethods(Class<?> hostClass, Consumer<Method> visitor) Visit all methods declared by the host class that can be fast-invoked.(package private) static <T extends Executable>
voidvisitMembers(T[] members, boolean samePackage, Consumer<T> visitor) Visit all subclass accessible members in the given array.private static voidvisitMethodHierarchy(Class<?> hostClass, Consumer<Method> visitor) Visit the method hierarchy for the host class.
-
Field Details
-
OVERRIDABLE_OBJECT_METHODS
-
-
Constructor Details
-
ClassBuilding
private ClassBuilding()
-
-
Method Details
-
signature
Minimum signature needed to disambiguate constructors from the same host class. -
signature
Minimum signature needed to disambiguate methods from the same host class. -
signature
Appends a semicolon-separated list of parameter types to the given name. -
canEnhance
Returns true if the given member can be enhanced using bytecode. -
buildEnhancerBuilder
Builder of enhancers that provide method interception via bytecode generation. -
partitionMethod
Methods are partitioned by name and parameter count. This helps focus the search for bridge delegates that involve type-erasure of generic parameter types, since the parameter count will be the same for the bridge method and its delegate. -
mergeMethods
Add the new method to an existing partition or create a new one. -
visitMethodHierarchy
Visit the method hierarchy for the host class. -
pushInterfaces
Pushes the interface declaration onto the stack if it's not empty. -
mergeInterface
Attempts to merge the interface with the current flattened hierarchy. -
packageName
Extract the package name from a class name. -
getOverridableObjectMethods
Cache common overridable Object methods. -
canFastInvoke
Returns true if the given member can be fast-invoked. -
isPublic
-
buildFastClass
public static Function<String,BiFunction<Object, buildFastClassObject[], Object>> (Class<?> hostClass) Builds a 'fast-class' invoker that uses bytecode generation in place of reflection. -
visitFastConstructors
Visit all constructors for the host class that can be fast-invoked. -
visitFastMethods
Visit all methods declared by the host class that can be fast-invoked. -
visitMembers
static <T extends Executable> void visitMembers(T[] members, boolean samePackage, Consumer<T> visitor) Visit all subclass accessible members in the given array. -
canAccess
Can we access this member from a subclass which may be in the same package?
-