public static ProcessAnnotatedTypeEventResolvable forProcessAnnotatedType(SlimAnnotatedType<?> annotatedType, RequiredAnnotationDiscovery discovery) { ParameterizedType type = new ParameterizedTypeImpl(ProcessAnnotatedType.class, new Type[] { annotatedType.getJavaClass() }, null); return new ProcessAnnotatedTypeEventResolvable(Sets.<Type> newHashSet(Object.class, type), annotatedType, discovery); }
Class<? super T> superclass = annotatedType.getJavaClass().getSuperclass(); if (superclass == null) { this.superclass = null; } else { this.superclass = classTransformer.getEnhancedAnnotatedType(superclass, slim.getIdentifier().getBdaId()); ArrayList<EnhancedAnnotatedField<?, ? super T>> declaredFieldsTemp = new ArrayList<EnhancedAnnotatedField<?, ? super T>>(); Class<T> javaClass = annotatedType.getJavaClass(); fieldsTemp = Sets.union(fieldsTemp, Reflections.<Set<EnhancedAnnotatedField<?, ? super T>>>cast(superclass.getFields())); EnhancedAnnotatedType<?> current = superclass; while (current.getJavaClass() != Object.class) { Set<EnhancedAnnotatedMethod<?, ? super T>> superClassMethods = Reflections.cast(current.getDeclaredEnhancedMethods()); methodsTemp.addAll(superClassMethods); current = current.getEnhancedSuperclass(); for (Class<?> interfaceClazz : Reflections.getInterfaceClosure(javaClass)) { EnhancedAnnotatedType<?> interfaceType = classTransformer.getEnhancedAnnotatedType(interfaceClazz, slim.getIdentifier().getBdaId()); for (EnhancedAnnotatedMethod<?, ?> interfaceMethod : interfaceType.getEnhancedMethods()) { processMetaAnnotations(declaredMetaAnnotationMap, declaredAnnotationMap.values(), classTransformer, true); this.declaredMetaAnnotationMap = Multimaps.unmodifiableMultimap(declaredMetaAnnotationMap); this.overriddenMethods = getOverriddenMethods(this, methodsTemp); methodsTemp.removeAll(getOverriddenMethods(this, methodsTemp, true));
private Class<T> createProxyClass(String proxyClassName) throws Exception { Set<Class<?>> specialInterfaces = Sets.newHashSet( LifecycleMixin.class, TargetInstanceProxy.class, ProxyObject.class); addAdditionalInterfaces(specialInterfaces); domain = cache.getProtectionDomainForProxy(domain); Class<T> proxyClass = cast(ClassFileUtils.toClass(proxyClassType, classLoader, domain)); BeanLogger.LOG.createdProxyClass(proxyClass, Arrays.toString(proxyClass.getInterfaces())); return proxyClass;
public FastProcessAnnotatedTypeResolver(Iterable<ObserverMethod<?>> observers) throws UnsupportedObserverMethodException { this.catchAllObservers = Sets.newHashSet(); this.observers = new LinkedHashMap<ExtensionObserverMethodImpl<?, ?>, Predicate<ClassFileInfo>>(); for (ObserverMethod<?> o : observers) { if (o instanceof ExtensionObserverMethodImpl<?, ?>) { final Set<Annotation> qualifiers = o.getObservedQualifiers(); // only process observer methods with no qualifiers or with @Any if (qualifiers.isEmpty() || (qualifiers.size() == 1 && Any.class.equals(qualifiers.iterator().next().annotationType()))) { process((ExtensionObserverMethodImpl<?, ?>) o, o.getObservedType()); } } } }
Class<? super T> superclass = annotatedType.getJavaClass().getSuperclass(); if (superclass == null) { this.superclass = null; } else { this.superclass = classTransformer.getEnhancedAnnotatedType(superclass, slim.getIdentifier().getBdaId()); ArrayList<EnhancedAnnotatedField<?, ? super T>> declaredFieldsTemp = new ArrayList<EnhancedAnnotatedField<?, ? super T>>(); Class<T> javaClass = annotatedType.getJavaClass(); fieldsTemp = Sets.union(fieldsTemp, Reflections.<Set<EnhancedAnnotatedField<?, ? super T>>>cast(superclass.getFields())); EnhancedAnnotatedType<?> current = superclass; while (current.getJavaClass() != Object.class) { Set<EnhancedAnnotatedMethod<?, ? super T>> superClassMethods = Reflections.cast(current.getDeclaredEnhancedMethods()); methodsTemp.addAll(superClassMethods); current = current.getEnhancedSuperclass(); for (Class<?> interfaceClazz : Reflections.getInterfaceClosure(javaClass)) { EnhancedAnnotatedType<?> interfaceType = classTransformer.getEnhancedAnnotatedType(interfaceClazz, slim.getIdentifier().getBdaId()); for (EnhancedAnnotatedMethod<?, ?> interfaceMethod : interfaceType.getEnhancedMethods()) { processMetaAnnotations(declaredMetaAnnotationMap, declaredAnnotationMap.values(), classTransformer, true); this.declaredMetaAnnotationMap = Multimaps.unmodifiableMultimap(declaredMetaAnnotationMap); this.overriddenMethods = getOverriddenMethods(this, methodsTemp); methodsTemp.removeAll(getOverriddenMethods(this, methodsTemp, true));
private Class<T> createProxyClass(Class<?> originalClass, String proxyClassName) throws Exception { Set<Class<?>> specialInterfaces = Sets.newHashSet(LifecycleMixin.class, TargetInstanceProxy.class, ProxyObject.class); addAdditionalInterfaces(specialInterfaces); proxyClass = cast(ClassFileUtils.toClass(proxyClassType, originalClass, proxyServices, domain)); } else { proxyClass = cast(ClassFileUtils.toClass(proxyClassType, classLoader, domain));
Class<? super T> superclass = annotatedType.getJavaClass().getSuperclass(); if (superclass == null) { this.superclass = null; } else { this.superclass = classTransformer.getEnhancedAnnotatedType(superclass, slim.getIdentifier().getBdaId()); ArrayList<EnhancedAnnotatedField<?, ? super T>> declaredFieldsTemp = new ArrayList<EnhancedAnnotatedField<?, ? super T>>(); Class<T> javaClass = annotatedType.getJavaClass(); fieldsTemp = Sets.union(fieldsTemp, Reflections.<Set<EnhancedAnnotatedField<?, ? super T>>>cast(superclass.getFields())); EnhancedAnnotatedType<?> current = superclass; while (current.getJavaClass() != Object.class) { Set<EnhancedAnnotatedMethod<?, ? super T>> superClassMethods = Reflections.cast(current.getDeclaredEnhancedMethods()); methodsTemp.addAll(superClassMethods); current = current.getEnhancedSuperclass(); for (Class<?> interfaceClazz : Reflections.getInterfaceClosure(javaClass)) { EnhancedAnnotatedType<?> interfaceType = classTransformer.getEnhancedAnnotatedType(interfaceClazz, slim.getIdentifier().getBdaId()); for (EnhancedAnnotatedMethod<?, ?> interfaceMethod : interfaceType.getEnhancedMethods()) { processMetaAnnotations(declaredMetaAnnotationMap, declaredAnnotationMap.values(), classTransformer, true); this.declaredMetaAnnotationMap = Multimaps.unmodifiableMultimap(declaredMetaAnnotationMap); this.overriddenMethods = getOverriddenMethods(this, methodsTemp); methodsTemp.removeAll(getOverriddenMethods(this, methodsTemp, true));
public static ProcessAnnotatedTypeEventResolvable forProcessAnnotatedType(SlimAnnotatedType<?> annotatedType, RequiredAnnotationDiscovery discovery) { ParameterizedType type = new ParameterizedTypeImpl(ProcessAnnotatedType.class, new Type[] { annotatedType.getJavaClass() }, null); return new ProcessAnnotatedTypeEventResolvable(Sets.<Type> newHashSet(Object.class, type), annotatedType, discovery); }
private Class<T> createProxyClass(Class<?> originalClass, String proxyClassName) throws Exception { Set<Class<?>> specialInterfaces = Sets.newHashSet(LifecycleMixin.class, TargetInstanceProxy.class, ProxyObject.class); addAdditionalInterfaces(specialInterfaces); proxyClass = cast(ClassFileUtils.toClass(proxyClassType, originalClass, proxyServices, domain)); } else { proxyClass = cast(ClassFileUtils.toClass(proxyClassType, classLoader, domain));
Class<? super T> superclass = annotatedType.getJavaClass().getSuperclass(); if (superclass == null) { this.superclass = null; } else { this.superclass = classTransformer.getEnhancedAnnotatedType(superclass, slim.getIdentifier().getBdaId()); ArrayList<EnhancedAnnotatedField<?, ? super T>> declaredFieldsTemp = new ArrayList<EnhancedAnnotatedField<?, ? super T>>(); Class<T> javaClass = annotatedType.getJavaClass(); fieldsTemp = Sets.union(fieldsTemp, Reflections.<Set<EnhancedAnnotatedField<?, ? super T>>>cast(superclass.getFields())); EnhancedAnnotatedType<?> current = superclass; while (current.getJavaClass() != Object.class) { Set<EnhancedAnnotatedMethod<?, ? super T>> superClassMethods = Reflections.cast(current.getDeclaredEnhancedMethods()); methodsTemp.addAll(superClassMethods); current = current.getEnhancedSuperclass(); for (Class<?> interfaceClazz : Reflections.getInterfaceClosure(javaClass)) { EnhancedAnnotatedType<?> interfaceType = classTransformer.getEnhancedAnnotatedType(interfaceClazz, slim.getIdentifier().getBdaId()); for (EnhancedAnnotatedMethod<?, ?> interfaceMethod : interfaceType.getEnhancedMethods()) { processMetaAnnotations(declaredMetaAnnotationMap, declaredAnnotationMap.values(), classTransformer, true); this.declaredMetaAnnotationMap = Multimaps.unmodifiableMultimap(declaredMetaAnnotationMap); this.overriddenMethods = getOverriddenMethods(this, methodsTemp); methodsTemp.removeAll(getOverriddenMethods(this, methodsTemp, true));
public static ProcessAnnotatedTypeEventResolvable forProcessAnnotatedType(SlimAnnotatedType<?> annotatedType, RequiredAnnotationDiscovery discovery) { ParameterizedType type = new ParameterizedTypeImpl(ProcessAnnotatedType.class, new Type[] { annotatedType.getJavaClass() }, null); return new ProcessAnnotatedTypeEventResolvable(Sets.<Type> newHashSet(Object.class, type), annotatedType, discovery); }
private Class<T> createProxyClass(Class<?> originalClass, String proxyClassName) throws Exception { Set<Class<?>> specialInterfaces = Sets.newHashSet(LifecycleMixin.class, TargetInstanceProxy.class, ProxyObject.class); addAdditionalInterfaces(specialInterfaces); proxyClass = cast(ClassFileUtils.toClass(proxyClassType, originalClass, proxyServices, domain)); } else { proxyClass = cast(ClassFileUtils.toClass(proxyClassType, classLoader, domain));
Class<? super T> superclass = annotatedType.getJavaClass().getSuperclass(); if (superclass == null) { this.superclass = null; } else { this.superclass = classTransformer.getEnhancedAnnotatedType(superclass, slim.getIdentifier().getBdaId()); ArrayList<EnhancedAnnotatedField<?, ? super T>> declaredFieldsTemp = new ArrayList<EnhancedAnnotatedField<?, ? super T>>(); Class<T> javaClass = annotatedType.getJavaClass(); fieldsTemp = Sets.union(fieldsTemp, Reflections.<Set<EnhancedAnnotatedField<?, ? super T>>>cast(superclass.getFields())); EnhancedAnnotatedType<?> current = superclass; while (current.getJavaClass() != Object.class) { Set<EnhancedAnnotatedMethod<?, ? super T>> superClassMethods = Reflections.cast(current.getDeclaredEnhancedMethods()); methodsTemp.addAll(superClassMethods); current = current.getEnhancedSuperclass(); for (Class<?> interfaceClazz : Reflections.getInterfaceClosure(javaClass)) { EnhancedAnnotatedType<?> interfaceType = classTransformer.getEnhancedAnnotatedType(interfaceClazz, slim.getIdentifier().getBdaId()); for (EnhancedAnnotatedMethod<?, ?> interfaceMethod : interfaceType.getEnhancedMethods()) { addMetaAnnotations(declaredMetaAnnotationMap, declaredAnnotation, classTransformer.getTypeStore().get(declaredAnnotation.annotationType()), true); declaredMetaAnnotationMap.put(declaredAnnotation.annotationType(), declaredAnnotation);