Class PersistenceUnitBinder.PersistenceUnitInjectionResolver

  • All Implemented Interfaces:
    InjectionResolver<javax.persistence.PersistenceUnit>
    Enclosing class:
    PersistenceUnitBinder

    @Singleton
    private static class PersistenceUnitBinder.PersistenceUnitInjectionResolver
    extends java.lang.Object
    implements InjectionResolver<javax.persistence.PersistenceUnit>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Map<java.lang.String,​java.lang.String> persistenceUnits  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Class<javax.persistence.PersistenceUnit> getAnnotation()
      This method returns the annotation for what the injection resolver is implemented.
      boolean isConstructorParameterIndicator()
      This method should return true if the annotation that indicates that this is an injection point can appear in the parameter list of a constructor.
      boolean isMethodParameterIndicator()
      This method should return true if the annotation that indicates that this is an injection point can appear in the parameter list of a method.
      java.lang.Object resolve​(Injectee injectee)
      This method will return the object that should be injected into the given injection point.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • persistenceUnits

        private final java.util.Map<java.lang.String,​java.lang.String> persistenceUnits
    • Constructor Detail

      • PersistenceUnitInjectionResolver

        private PersistenceUnitInjectionResolver​(javax.servlet.ServletConfig servletConfig)
    • Method Detail

      • resolve

        public java.lang.Object resolve​(Injectee injectee)
        Description copied from interface: InjectionResolver
        This method will return the object that should be injected into the given injection point. It is the responsibility of the implementation to ensure that the object returned can be safely injected into the injection point.

        This method should not do the injection themselves.

        Specified by:
        resolve in interface InjectionResolver<javax.persistence.PersistenceUnit>
        Parameters:
        injectee - The injection point this value is being injected into
        Returns:
        A possibly null value to be injected into the given injection point
      • isConstructorParameterIndicator

        public boolean isConstructorParameterIndicator()
        Description copied from interface: InjectionResolver
        This method should return true if the annotation that indicates that this is an injection point can appear in the parameter list of a constructor.
        Specified by:
        isConstructorParameterIndicator in interface InjectionResolver<javax.persistence.PersistenceUnit>
        Returns:
        true if the injection annotation can appear in the parameter list of a constructor.
      • isMethodParameterIndicator

        public boolean isMethodParameterIndicator()
        Description copied from interface: InjectionResolver
        This method should return true if the annotation that indicates that this is an injection point can appear in the parameter list of a method.
        Specified by:
        isMethodParameterIndicator in interface InjectionResolver<javax.persistence.PersistenceUnit>
        Returns:
        true if the injection annotation can appear in the parameter list of a method.
      • getAnnotation

        public java.lang.Class<javax.persistence.PersistenceUnit> getAnnotation()
        Description copied from interface: InjectionResolver
        This method returns the annotation for what the injection resolver is implemented.
        Specified by:
        getAnnotation in interface InjectionResolver<javax.persistence.PersistenceUnit>
        Returns:
        handled annotation by injection resolver.