Class Decorators


  • public class Decorators
    extends Object
    Helper class for inspections.
    Author:
    Marius Bogoevici
    • Method Detail

      • getDecoratorMethods

        public static Set<InvokableAnnotatedMethod<?>> getDecoratorMethods​(BeanManagerImpl beanManager,
                                                                           WeldDecorator<?> decorator)
        Determines the set of InvokableAnnotatedMethods representing decorated methods of the specified decorator. A decorated method is any method declared by a decorated type which is implemented by the decorator.
        Parameters:
        beanManager - the bean manager
        decorator - the specified decorator
        Returns:
        the set of InvokableAnnotatedMethods representing decorated methods of the specified decorator
      • findDelegateInjectionPoint

        public static WeldInjectionPointAttributes<?,​?> findDelegateInjectionPoint​(jakarta.enterprise.inject.spi.AnnotatedType<?> type,
                                                                                         Iterable<jakarta.enterprise.inject.spi.InjectionPoint> injectionPoints)
      • getOuterDelegate

        public static <T> T getOuterDelegate​(jakarta.enterprise.inject.spi.Bean<T> bean,
                                             T instance,
                                             jakarta.enterprise.context.spi.CreationalContext<T> creationalContext,
                                             Class<T> proxyClass,
                                             jakarta.enterprise.inject.spi.InjectionPoint originalInjectionPoint,
                                             BeanManagerImpl manager,
                                             List<jakarta.enterprise.inject.spi.Decorator<?>> decorators)
      • checkDelegateType

        public static void checkDelegateType​(jakarta.enterprise.inject.spi.Decorator<?> decorator)
        Check whether the delegate type implements or extends all decorated types.
        Parameters:
        decorator -
        Throws:
        DefinitionException - If the delegate type doesn't implement or extend all decorated types
      • checkAbstractMethods

        public static <T> void checkAbstractMethods​(Set<Type> decoratedTypes,
                                                    EnhancedAnnotatedType<T> type,
                                                    BeanManagerImpl beanManager)
        Check all abstract methods are declared by the decorated types.
        Parameters:
        type -
        beanManager -
        delegateType -
        Throws:
        DefinitionException - If any of the abstract methods is not declared by the decorated types
      • isPassivationCapable

        public static boolean isPassivationCapable​(jakarta.enterprise.inject.spi.Decorator<?> decorator)
        Indicates whether a Decorator is passivation capable or not.
        Returns: