Package com.google.inject.internal
Enum InternalFlags.BytecodeGenOption
- java.lang.Object
-
- java.lang.Enum<InternalFlags.BytecodeGenOption>
-
- com.google.inject.internal.InternalFlags.BytecodeGenOption
-
- All Implemented Interfaces:
Serializable
,Comparable<InternalFlags.BytecodeGenOption>
- Enclosing class:
- InternalFlags
public static enum InternalFlags.BytecodeGenOption extends Enum<InternalFlags.BytecodeGenOption>
Options for controlling whether Guice uses bytecode generation at runtime. When bytecode generation is enabled, the following features will be enabled in Guice:- Runtime bytecode generation (instead of reflection) will be used when Guice need to invoke application code.
- Method interception.
Bytecode generation is generally faster than using reflection when invoking application code, however, it can use more memory and slower in certain cases due to the time spent in generating the classes. If you prefer to use reflection over bytecode generation then set
InternalFlags.BytecodeGenOption
toDISABLED
.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static InternalFlags.BytecodeGenOption
valueOf(String name)
Returns the enum constant of this type with the specified name.static InternalFlags.BytecodeGenOption[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
DISABLED
public static final InternalFlags.BytecodeGenOption DISABLED
Bytecode generation is disabled and using features that require it such as method interception will throw errors at run time.
-
ENABLED
public static final InternalFlags.BytecodeGenOption ENABLED
Bytecode generation is enabled.
-
-
Method Detail
-
values
public static InternalFlags.BytecodeGenOption[] 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 (InternalFlags.BytecodeGenOption c : InternalFlags.BytecodeGenOption.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static InternalFlags.BytecodeGenOption 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 nameNullPointerException
- if the argument is null
-
-