org.apache.commons.inject.api.bind
Enum Scopes

java.lang.Object
  extended by java.lang.Enum<Scopes>
      extended by org.apache.commons.inject.api.bind.Scopes
All Implemented Interfaces:
Serializable, Comparable<Scopes>

public enum Scopes
extends Enum<Scopes>

List of the supported scopes.


Enum Constant Summary
EAGER_SINGLETON
          A binding with scope EAGER_SINGLETON will create a single instance, which is injected whenever the binding is used to inject a value.
LAZY_SINGLETON
          A binding with scope EAGER_SINGLETON will create a single instance, which is injected whenever the binding is used to inject a value.
PER_CALL
          A binding with scope PER_CALL will create a new instance, whenever the binding is used to inject a value.
 
Method Summary
static Scopes valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Scopes[] 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

PER_CALL

public static final Scopes PER_CALL
A binding with scope PER_CALL will create a new instance, whenever the binding is used to inject a value.


EAGER_SINGLETON

public static final Scopes EAGER_SINGLETON
A binding with scope EAGER_SINGLETON will create a single instance, which is injected whenever the binding is used to inject a value. The instance will be created immediately.


LAZY_SINGLETON

public static final Scopes LAZY_SINGLETON
A binding with scope EAGER_SINGLETON will create a single instance, which is injected whenever the binding is used to inject a value. The instance will be created as soon as required.

Method Detail

values

public static Scopes[] 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 (Scopes c : Scopes.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Scopes valueOf(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:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null


Copyright © 2014 The Apache Software Foundation. All Rights Reserved.