Class ImmutableInjectionPoint

  • All Implemented Interfaces:
    InjectionPoint

    public class ImmutableInjectionPoint
    extends Object
    implements InjectionPoint

    A base class for implementing InjectionPoint. The attributes are immutable, and collections are defensively copied on instantiation.

    Author:
    Stuart Douglas, Pete Muir
    • Constructor Detail

      • ImmutableInjectionPoint

        public ImmutableInjectionPoint​(AnnotatedField<?> field,
                                       Set<Annotation> qualifiers,
                                       Bean<?> declaringBean,
                                       boolean _transient,
                                       boolean delegate)
        Instantiate a new InjectionPoint based upon an AnnotatedField.
        Parameters:
        field - the field for which to create the injection point
        qualifiers - the qualifiers on the injection point
        declaringBean - the declaringBean declaring the injection point
        _transient - true if the injection point is transient
        delegate - true if the injection point is a delegate injection point on a decorator
      • ImmutableInjectionPoint

        public ImmutableInjectionPoint​(AnnotatedField<?> field,
                                       BeanManager beanManager,
                                       Bean<?> declaringBean,
                                       boolean _transient,
                                       boolean delegate)
        Instantiate a new InjectionPoint based upon an AnnotatedField, reading the qualifiers from the annotations declared on the field.
        Parameters:
        field - the field for which to create the injection point
        declaringBean - the declaringBean declaring the injection point
        _transient - true if the injection point is transient
        delegate - true if the injection point is a delegate injection point on a decorator
      • ImmutableInjectionPoint

        public ImmutableInjectionPoint​(AnnotatedParameter<?> parameter,
                                       Set<Annotation> qualifiers,
                                       Bean<?> declaringBean,
                                       boolean _transient,
                                       boolean delegate)
        Instantiate a new InjectionPoint based upon an AnnotatedParameter.
        Parameters:
        parameter - the parameter for which to create the injection point
        qualifiers - the qualifiers on the injection point
        declaringBean - the declaringBean declaring the injection point
        _transient - true if the injection point is transient
        delegate - true if the injection point is a delegate injection point on a decorator
      • ImmutableInjectionPoint

        public ImmutableInjectionPoint​(AnnotatedParameter<?> parameter,
                                       BeanManager beanManager,
                                       Bean<?> declaringBean,
                                       boolean _transient,
                                       boolean delegate)
        Instantiate a new InjectionPoint based upon an AnnotatedParameter, reading the qualifiers from the annotations declared on the parameter.
        Parameters:
        parameter - the parameter for which to create the injection point
        declaringBean - the declaringBean declaring the injection point
        _transient - true if the injection point is transient
        delegate - true if the injection point is a delegate injection point on a decorator
    • Method Detail

      • getBean

        public Bean<?> getBean()
        Description copied from interface: InjectionPoint
        Get the Bean object representing the bean that defines the injection point. If the injection point does not belong to a bean, return a null value.
        Specified by:
        getBean in interface InjectionPoint
        Returns:
        the Bean object representing bean that defines the injection point, of null if the injection point does not belong to a bean
      • getMember

        public Member getMember()
        Description copied from interface: InjectionPoint
        Get the Field object in the case of field injection, the Method object in the case of method parameter injection or the Constructor object in the case of constructor parameter injection.
        Specified by:
        getMember in interface InjectionPoint
        Returns:
        the member
      • getType

        public Type getType()
        Description copied from interface: InjectionPoint
        Get the required type of injection point.
        Specified by:
        getType in interface InjectionPoint
        Returns:
        the required type
      • isDelegate

        public boolean isDelegate()
        Description copied from interface: InjectionPoint
        Determines if the injection point is a decorator delegate injection point.
        Specified by:
        isDelegate in interface InjectionPoint
        Returns:
        true if the injection point is a decorator delegate injection point, and false otherwise
      • isTransient

        public boolean isTransient()
        Description copied from interface: InjectionPoint
        Determines if the injection is a transient field.
        Specified by:
        isTransient in interface InjectionPoint
        Returns:
        true if the injection point is a transient field, and false otherwise