public static <T> EnhancedAnnotatedType<T> createEnhancedAnnotatedType(BasicInjectionTarget<T> it) { return EnhancedAnnotatedTypeImpl.of( (SlimAnnotatedType<T>) it.getAnnotatedType(), ClassTransformer.instance(it.getBeanManager())); }
/** * Call this method after all observer methods of this event have been invoked to get the final value of this {@link AnnotatedType}. * * @return the resulting annotated type */ public SlimAnnotatedType<X> getResultingAnnotatedType() { if (isDirty()) { return ClassTransformer.instance(manager).getUnbackedAnnotatedType(originalAnnotatedType, annotatedType); } else { return originalAnnotatedType; } }
/** * Call this method after all observer methods of this event have been invoked to get the final value of this {@link AnnotatedType}. * * @return the resulting annotated type */ public SlimAnnotatedType<X> getResultingAnnotatedType() { if (isDirty()) { return ClassTransformer.instance(manager).getUnbackedAnnotatedType(originalAnnotatedType, annotatedType); } else { return originalAnnotatedType; } }
/** * Call this method after all observer methods of this event have been invoked to get the final value of this {@link AnnotatedType}. * * @return */ public SlimAnnotatedType<X> getResultingAnnotatedType() { if (isDirty()) { return ClassTransformer.instance(manager).getUnbackedAnnotatedType(originalAnnotatedType, annotatedType); } else { return originalAnnotatedType; } }
/** * Call this method after all observer methods of this event have been invoked to get the final value of this {@link AnnotatedType}. * * @return the resulting annotated type */ public SlimAnnotatedType<X> getResultingAnnotatedType() { if (isDirty()) { return ClassTransformer.instance(manager).getUnbackedAnnotatedType(originalAnnotatedType, annotatedType); } else { return originalAnnotatedType; } }
/** * Call this method after all observer methods of this event have been invoked to get the final value of this {@link AnnotatedType}. * * @return the resulting annotated type */ public SlimAnnotatedType<X> getResultingAnnotatedType() { if (isDirty()) { return ClassTransformer.instance(manager).getUnbackedAnnotatedType(originalAnnotatedType, annotatedType); } else { return originalAnnotatedType; } }
/** * Call this method after all observer methods of this event have been invoked to get the final value of this {@link AnnotatedType}. * * @return the resulting annotated type */ public SlimAnnotatedType<X> getResultingAnnotatedType() { if (isDirty()) { return ClassTransformer.instance(manager).getUnbackedAnnotatedType(originalAnnotatedType, annotatedType); } else { return originalAnnotatedType; } }
/** * Check all abstract methods are declared by the decorated types. * * @param type * @param beanManager * @param delegateType * @throws DefinitionException If any of the abstract methods is not declared by the decorated types */ public static <T> void checkAbstractMethods(Set<Type> decoratedTypes, EnhancedAnnotatedType<T> type, BeanManagerImpl beanManager) { if (decoratedTypes == null) { decoratedTypes = new HashSet<Type>(type.getInterfaceClosure()); decoratedTypes.remove(Serializable.class); } Set<MethodSignature> signatures = new HashSet<MethodSignature>(); for (Type decoratedType : decoratedTypes) { for (EnhancedAnnotatedMethod<?, ?> method : ClassTransformer.instance(beanManager) .getEnhancedAnnotatedType(Reflections.getRawType(decoratedType), beanManager.getId()).getEnhancedMethods()) { signatures.add(method.getSignature()); } } for (EnhancedAnnotatedMethod<?, ?> method : type.getEnhancedMethods()) { if (Reflections.isAbstract(((AnnotatedMethod<?>) method).getJavaMember())) { MethodSignature methodSignature = method.getSignature(); if (!signatures.contains(methodSignature)) { throw BeanLogger.LOG.abstractMethodMustMatchDecoratedType(method, Formats.formatAsStackTraceElement(method.getJavaMember())); } } } }
/** * Check all abstract methods are declared by the decorated types. * * @param type * @param beanManager * @param delegateType * @throws DefinitionException If any of the abstract methods is not declared by the decorated types */ public static <T> void checkAbstractMethods(Set<Type> decoratedTypes, EnhancedAnnotatedType<T> type, BeanManagerImpl beanManager) { if (decoratedTypes == null) { decoratedTypes = new HashSet<Type>(type.getInterfaceClosure()); decoratedTypes.remove(Serializable.class); } Set<MethodSignature> signatures = new HashSet<MethodSignature>(); for (Type decoratedType : decoratedTypes) { for (EnhancedAnnotatedMethod<?, ?> method : ClassTransformer.instance(beanManager) .getEnhancedAnnotatedType(Reflections.getRawType(decoratedType), beanManager.getId()).getEnhancedMethods()) { signatures.add(method.getSignature()); } } for (EnhancedAnnotatedMethod<?, ?> method : type.getEnhancedMethods()) { if (Reflections.isAbstract(((AnnotatedMethod<?>) method).getJavaMember())) { MethodSignature methodSignature = method.getSignature(); if (!signatures.contains(methodSignature)) { throw BeanLogger.LOG.abstractMethodMustMatchDecoratedType(method, Formats.formatAsStackTraceElement(method.getJavaMember())); } } } }
/** * Check all abstract methods are declared by the decorated types. * * @param type * @param beanManager * @param delegateType * @throws DefinitionException If any of the abstract methods is not declared by the decorated types */ public static <T> void checkAbstractMethods(Set<Type> decoratedTypes, EnhancedAnnotatedType<T> type, BeanManagerImpl beanManager) { if (decoratedTypes == null) { decoratedTypes = new HashSet<Type>(type.getInterfaceClosure()); decoratedTypes.remove(Serializable.class); } Set<MethodSignature> signatures = new HashSet<MethodSignature>(); for (Type decoratedType : decoratedTypes) { for (EnhancedAnnotatedMethod<?, ?> method : ClassTransformer.instance(beanManager) .getEnhancedAnnotatedType(Reflections.getRawType(decoratedType), beanManager.getId()).getEnhancedMethods()) { signatures.add(method.getSignature()); } } for (EnhancedAnnotatedMethod<?, ?> method : type.getEnhancedMethods()) { if (Reflections.isAbstract(((AnnotatedMethod<?>) method).getJavaMember())) { MethodSignature methodSignature = method.getSignature(); if (!signatures.contains(methodSignature)) { throw BeanLogger.LOG.abstractMethodMustMatchDecoratedType(method, Formats.formatAsStackTraceElement(method.getJavaMember())); } } } }
/** * Check all abstract methods are declared by the decorated types. * * @param type * @param beanManager * @param delegateType * @throws DefinitionException If any of the abstract methods is not declared by the decorated types */ public static <T> void checkAbstractMethods(Set<Type> decoratedTypes, EnhancedAnnotatedType<T> type, BeanManagerImpl beanManager) { if (decoratedTypes == null) { decoratedTypes = new HashSet<Type>(type.getInterfaceClosure()); decoratedTypes.remove(Serializable.class); } Set<MethodSignature> signatures = new HashSet<MethodSignature>(); for (Type decoratedType : decoratedTypes) { for (EnhancedAnnotatedMethod<?, ?> method : ClassTransformer.instance(beanManager) .getEnhancedAnnotatedType(Reflections.getRawType(decoratedType), beanManager.getId()).getEnhancedMethods()) { signatures.add(method.getSignature()); } } for (EnhancedAnnotatedMethod<?, ?> method : type.getEnhancedMethods()) { if (Reflections.isAbstract(((AnnotatedMethod<?>) method).getJavaMember())) { MethodSignature methodSignature = method.getSignature(); if (!signatures.contains(methodSignature)) { throw BeanLogger.LOG.abstractMethodMustMatchDecoratedType(method, Formats.formatAsStackTraceElement(method.getJavaMember())); } } } }
/** * Check all abstract methods are declared by the decorated types. * * @param type * @param beanManager * @param delegateType * @throws DefinitionException If any of the abstract methods is not declared by the decorated types */ public static <T> void checkAbstractMethods(Set<Type> decoratedTypes, EnhancedAnnotatedType<T> type, BeanManagerImpl beanManager) { if (decoratedTypes == null) { decoratedTypes = new HashSet<Type>(type.getInterfaceClosure()); decoratedTypes.remove(Serializable.class); } Set<MethodSignature> signatures = new HashSet<MethodSignature>(); for (Type decoratedType : decoratedTypes) { for (EnhancedAnnotatedMethod<?, ?> method : ClassTransformer.instance(beanManager) .getEnhancedAnnotatedType(Reflections.getRawType(decoratedType), beanManager.getId()).getEnhancedMethods()) { signatures.add(method.getSignature()); } } for (EnhancedAnnotatedMethod<?, ?> method : type.getEnhancedMethods()) { if (Reflections.isAbstract(((AnnotatedMethod<?>) method).getJavaMember())) { MethodSignature methodSignature = method.getSignature(); if (!signatures.contains(methodSignature)) { throw BeanLogger.LOG.abstractMethodMustMatchDecoratedType(method, Formats.formatAsStackTraceElement(method.getJavaMember())); } } } }
/** * Check all abstract methods are declared by the decorated types. * * @param type * @param beanManager * @param delegateType * @throws DefinitionException If any of the abstract methods is not declared by the decorated types */ public static <T> void checkAbstractMethods(Set<Type> decoratedTypes, EnhancedAnnotatedType<T> type, BeanManagerImpl beanManager) { if (decoratedTypes == null) { decoratedTypes = new HashSet<Type>(type.getInterfaceClosure()); decoratedTypes.remove(Serializable.class); } Set<MethodSignature> signatures = new HashSet<MethodSignature>(); for (Type decoratedType : decoratedTypes) { for (EnhancedAnnotatedMethod<?, ?> method : ClassTransformer.instance(beanManager) .getEnhancedAnnotatedType(Reflections.getRawType(decoratedType), beanManager.getId()).getEnhancedMethods()) { signatures.add(method.getSignature()); } } for (EnhancedAnnotatedMethod<?, ?> method : type.getEnhancedMethods()) { if (Reflections.isAbstract(((AnnotatedMethod<?>) method).getJavaMember())) { MethodSignature methodSignature = method.getSignature(); if (!signatures.contains(methodSignature)) { throw BeanLogger.LOG.abstractMethodMustMatchDecoratedType(method, Formats.formatAsStackTraceElement(method.getJavaMember())); } } } }