Enum DeclarationType

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<DeclarationType>

    public enum DeclarationType
    extends java.lang.Enum<DeclarationType>
    Guice binding declaration type. Note that type could be different, depending if it's element taken with SPI from guice module or binding from injector.
    Since:
    13.08.2019
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      Aop
      Aop interceptor registration (bindInterceptor(..)).
      Binding
      Used for all types, instantiated by guice (mostly right sides).
      ConvertedConstant
      Dynamic binding, constructed from bound string constant (using TypeConverter).
      Exposed
      Exposed binding from private module.
      FilterInstance
      Http filter registration by instance.
      FilterKey
      Http filter registration by class.
      Instance
      Instance binding (bing(Smth.class).toInstance(obj)).
      LinkedKey
      Linked binding declaration (bind(Smth.class).to(Other.class),, where Other may be already declared before as separate binding).
      ProviderInstance
      Bound provider instance (bind(Smth.class).toProvider(obj)).
      ProviderKey
      Provider by key (bind(Smth.class).toProvider(DmthProv.class)).
      ProviderMethod
      Provider method in module (annotated with Provides).
      ProvisionListener
      ProvisionListener registration (bindListener(..)).
      Scope
      Scope declaration (bindScope(...)).
      ServletInstance
      Http servlet registration by instance.
      ServletKey
      Http servlet registration by class.
      TypeConverter
      TypeConverter registration (convertToTypes(,,)).
      TypeListener
      TypeListener registration (bindListener(..)).
      Untargetted
      Untargetted binding (bind(Smth.class)).
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static DeclarationType detect​(java.lang.Class<? extends com.google.inject.spi.Element> type)  
      java.lang.Class<?> getType()  
      boolean isRuntimeBinding()  
      static DeclarationType valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static DeclarationType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • Scope

        public static final DeclarationType Scope
        Scope declaration (bindScope(...)). Appear only on module analysis.
      • Instance

        public static final DeclarationType Instance
        Instance binding (bing(Smth.class).toInstance(obj)).
      • ProviderInstance

        public static final DeclarationType ProviderInstance
        Bound provider instance (bind(Smth.class).toProvider(obj)).
      • LinkedKey

        public static final DeclarationType LinkedKey
        Linked binding declaration (bind(Smth.class).to(Other.class),, where Other may be already declared before as separate binding).
      • ProviderKey

        public static final DeclarationType ProviderKey
        Provider by key (bind(Smth.class).toProvider(DmthProv.class)).
      • Untargetted

        public static final DeclarationType Untargetted
        Untargetted binding (bind(Smth.class)). Appear only for module elements analysis. When queried binding from injector these bindings would be ConstructorBinding (and detected as Binding below).
      • Aop

        public static final DeclarationType Aop
        Aop interceptor registration (bindInterceptor(..)). Appear only for module elements analysis.
      • TypeListener

        public static final DeclarationType TypeListener
        TypeListener registration (bindListener(..)). Appear only for module elements analysis.
      • ProvisionListener

        public static final DeclarationType ProvisionListener
        ProvisionListener registration (bindListener(..)). Appear only for module elements analysis.
      • TypeConverter

        public static final DeclarationType TypeConverter
        TypeConverter registration (convertToTypes(,,)). Appear only for module elements analysis.
      • ProviderMethod

        public static final DeclarationType ProviderMethod
        Provider method in module (annotated with Provides).
      • Exposed

        public static final DeclarationType Exposed
        Exposed binding from private module. NOTE: only first level of exposed bindings are shown and so if private module use private module inside of it - second level exposures will not be visible in report! (logic: can't use - no need to see). Anyway, even on lower levels bindings will be marked as exposed (with a marker at the end).
      • FilterKey

        public static final DeclarationType FilterKey
        Http filter registration by class. This is not real binding, it could only be revealed with extensions target visitor. Real binding in injector is ignored (it's marked as internal).
      • FilterInstance

        public static final DeclarationType FilterInstance
        Http filter registration by instance. This is not real binding, it could only be revealed with extensions target visitor. Real binding in injector is ignored (it's marked as internal).
      • ServletKey

        public static final DeclarationType ServletKey
        Http servlet registration by class. This is not real binding, it could only be revealed with extensions target visitor. Real binding in injector is ignored (it's marked as internal).
      • ServletInstance

        public static final DeclarationType ServletInstance
        Http servlet registration by instance. This is not real binding, it could only be revealed with extensions target visitor. Real binding in injector is ignored (it's marked as internal).
      • Binding

        public static final DeclarationType Binding
        Used for all types, instantiated by guice (mostly right sides). Appear instead of Untargetted bindings for bindings requested from injector.
      • ConvertedConstant

        public static final DeclarationType ConvertedConstant
        Dynamic binding, constructed from bound string constant (using TypeConverter).
    • Method Detail

      • values

        public static DeclarationType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (DeclarationType c : DeclarationType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static DeclarationType valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • isRuntimeBinding

        public boolean isRuntimeBinding()
        Returns:
        true for actual bindings in injector, false for configuration time elements (scopes, listeners).
      • getType

        public java.lang.Class<?> getType()
        Returns:
        binding type
      • detect

        public static DeclarationType detect​(java.lang.Class<? extends com.google.inject.spi.Element> type)
        Parameters:
        type - guice element
        Returns:
        detected type or null