Top Description Inners Fields Constructors Methods
com.google.inject.internal

public final Class InternalFlags

extends Object
Class Inheritance
Imports
java.security.AccessController, .PrivilegedAction, java.util.Arrays, java.util.logging.Logger

Contains flags for Guice.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
InternalFlags.BytecodeGenOption

Options for controlling whether Guice uses bytecode generation at runtime.

public static enum
InternalFlags.ColorizeOption

Options for enable or disable using ansi color in error messages.

public static enum
InternalFlags.CustomClassLoadingOption

The options for Guice custom class loading.

public static enum
InternalFlags.IncludeStackTraceOption

The options for Guice stack trace collection.

public static enum
InternalFlags.NullableProvidesOption

Options for handling nullable parameters used in provides methods.

Field Summary

Modifier and TypeField and Description
private static final InternalFlags.BytecodeGenOption
private static final InternalFlags.ColorizeOption
private static final InternalFlags.CustomClassLoadingOption
private static final InternalFlags.IncludeStackTraceOption
private static final Logger
private static final InternalFlags.NullableProvidesOption

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static boolean
public static InternalFlags.CustomClassLoadingOption
public static InternalFlags.IncludeStackTraceOption
public static InternalFlags.NullableProvidesOption
private static <T extends Enum<T>> T

Returns:

value of the option, defaultValue if not set
getSystemOption
(final String
of the system option
name
,
T
if the option is not set
defaultValue
)

Gets the system option indicated by the specified key; runs as a privileged action.

private static <T extends Enum<T>> T

Returns:

value of the option, defaultValue if not set, secureValue if no access
getSystemOption
(final String
of the system option
name
,
T
if the option is not set
defaultValue
,
T
if the security manager disallows access to the option
secureValue
)

Gets the system option indicated by the specified key; runs as a privileged action.

public static boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BYTECODE_GEN_OPTIONback to summary
private static final InternalFlags.BytecodeGenOption BYTECODE_GEN_OPTION
COLORIZE_OPTIONback to summary
private static final InternalFlags.ColorizeOption COLORIZE_OPTION
CUSTOM_CLASS_LOADINGback to summary
private static final InternalFlags.CustomClassLoadingOption CUSTOM_CLASS_LOADING
INCLUDE_STACK_TRACESback to summary
private static final InternalFlags.IncludeStackTraceOption INCLUDE_STACK_TRACES
loggerback to summary
private static final Logger logger
NULLABLE_PROVIDESback to summary
private static final InternalFlags.NullableProvidesOption NULLABLE_PROVIDES

Constructor Detail

InternalFlagsback to summary
private InternalFlags()

Method Detail

enableColorizeErrorMessagesback to summary
public static boolean enableColorizeErrorMessages()
getCustomClassLoadingOptionback to summary
public static InternalFlags.CustomClassLoadingOption getCustomClassLoadingOption()
getIncludeStackTraceOptionback to summary
public static InternalFlags.IncludeStackTraceOption getIncludeStackTraceOption()
getNullableProvidesOptionback to summary
public static InternalFlags.NullableProvidesOption getNullableProvidesOption()
getSystemOptionback to summary
private static <T extends Enum<T>> T getSystemOption(final String name, T defaultValue)

Gets the system option indicated by the specified key; runs as a privileged action.

Parameters
name:String

of the system option

defaultValue:T

if the option is not set

Returns:T

value of the option, defaultValue if not set

getSystemOptionback to summary
private static <T extends Enum<T>> T getSystemOption(final String name, T defaultValue, T secureValue)

Gets the system option indicated by the specified key; runs as a privileged action.

Parameters
name:String

of the system option

defaultValue:T

if the option is not set

secureValue:T

if the security manager disallows access to the option

Returns:T

value of the option, defaultValue if not set, secureValue if no access

isBytecodeGenEnabledback to summary
public static boolean isBytecodeGenEnabled()
com.google.inject.internal back to summary

public final Enum InternalFlags.BytecodeGenOption

extends Enum<InternalFlags.BytecodeGenOption>
Class Inheritance

Options for controlling whether Guice uses bytecode generation at runtime. When bytecode generation is enabled, the following features will be enabled in Guice:

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 BytecodeGenOption to DISABLED.

Field Summary

Modifier and TypeField and Description
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.

public static final InternalFlags.BytecodeGenOption
ENABLED

Bytecode generation is enabled.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static InternalFlags.BytecodeGenOption
public static InternalFlags.BytecodeGenOption[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

DISABLEDback to summary
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.

ENABLEDback to summary
public static final InternalFlags.BytecodeGenOption ENABLED

Bytecode generation is enabled.

Constructor Detail

BytecodeGenOptionback to summary
private BytecodeGenOption()

Method Detail

valueOfback to summary
public static InternalFlags.BytecodeGenOption valueOf(String name)
valuesback to summary
public static InternalFlags.BytecodeGenOption[] values()
com.google.inject.internal back to summary

public sealed Enum InternalFlags.ColorizeOption

extends Enum<InternalFlags.ColorizeOption>
Class Inheritance

Options for enable or disable using ansi color in error messages.

Field Summary

Modifier and TypeField and Description
public static final InternalFlags.ColorizeOption
public static final InternalFlags.ColorizeOption
public static final InternalFlags.ColorizeOption

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv abstract boolean
public static InternalFlags.ColorizeOption
public static InternalFlags.ColorizeOption[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

AUTOback to summary
public static final InternalFlags.ColorizeOption AUTO
OFFback to summary
public static final InternalFlags.ColorizeOption OFF
ONback to summary
public static final InternalFlags.ColorizeOption ON

Constructor Detail

ColorizeOptionback to summary
private ColorizeOption()

Method Detail

enabledback to summary
pack-priv abstract boolean enabled()
valueOfback to summary
public static InternalFlags.ColorizeOption valueOf(String name)
valuesback to summary
public static InternalFlags.ColorizeOption[] values()
com.google.inject.internal back to summary

public final Enum InternalFlags.CustomClassLoadingOption

extends Enum<InternalFlags.CustomClassLoadingOption>
Class Inheritance

The options for Guice custom class loading.

Field Summary

Modifier and TypeField and Description
public static final InternalFlags.CustomClassLoadingOption
ANONYMOUS

Define fast/enhanced types anonymously as hidden nest-mates, never creates class loaders.

public static final InternalFlags.CustomClassLoadingOption
BRIDGE

Attempt to define fast/enhanced types in the same class loader as their original type.

public static final InternalFlags.CustomClassLoadingOption
CHILD

Define fast/enhanced types in a child class loader whose parent is the original class loader.

public static final InternalFlags.CustomClassLoadingOption
OFF

Define fast/enhanced types in the same class loader as their original type, never creates class loaders.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static InternalFlags.CustomClassLoadingOption
public static InternalFlags.CustomClassLoadingOption[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ANONYMOUSback to summary
public static final InternalFlags.CustomClassLoadingOption ANONYMOUS

Define fast/enhanced types anonymously as hidden nest-mates, never creates class loaders. This is faster than regular class loading and the resulting classes are easier to unload.

Note

with this option you cannot look up fast/enhanced types by name or mock/spy them.

BRIDGEback to summary
public static final InternalFlags.CustomClassLoadingOption BRIDGE

Attempt to define fast/enhanced types in the same class loader as their original type. Otherwise creates a child class loader whose parent is the original class loader. (Default)

CHILDback to summary
public static final InternalFlags.CustomClassLoadingOption CHILD

Define fast/enhanced types in a child class loader whose parent is the original class loader.

Note

with this option you cannot intercept package-private methods.

OFFback to summary
public static final InternalFlags.CustomClassLoadingOption OFF

Define fast/enhanced types in the same class loader as their original type, never creates class loaders. Uses sun.misc.Unsafe to gain access to existing class loaders.

Constructor Detail

CustomClassLoadingOptionback to summary
private CustomClassLoadingOption()

Method Detail

valueOfback to summary
public static InternalFlags.CustomClassLoadingOption valueOf(String name)
valuesback to summary
public static InternalFlags.CustomClassLoadingOption[] values()
com.google.inject.internal back to summary

public final Enum InternalFlags.IncludeStackTraceOption

extends Enum<InternalFlags.IncludeStackTraceOption>
Class Inheritance

The options for Guice stack trace collection.

Field Summary

Modifier and TypeField and Description
public static final InternalFlags.IncludeStackTraceOption
OFF

No stack trace collection

public static final InternalFlags.IncludeStackTraceOption
ONLY_FOR_DECLARING_SOURCE

Minimum stack trace collection (Default)

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static InternalFlags.IncludeStackTraceOption
public static InternalFlags.IncludeStackTraceOption[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

OFFback to summary
public static final InternalFlags.IncludeStackTraceOption OFF

No stack trace collection

ONLY_FOR_DECLARING_SOURCEback to summary
public static final InternalFlags.IncludeStackTraceOption ONLY_FOR_DECLARING_SOURCE

Minimum stack trace collection (Default)

Constructor Detail

IncludeStackTraceOptionback to summary
private IncludeStackTraceOption()

Method Detail

valueOfback to summary
public static InternalFlags.IncludeStackTraceOption valueOf(String name)
valuesback to summary
public static InternalFlags.IncludeStackTraceOption[] values()
com.google.inject.internal back to summary

public final Enum InternalFlags.NullableProvidesOption

extends Enum<InternalFlags.NullableProvidesOption>
Class Inheritance

Options for handling nullable parameters used in provides methods.

Field Summary

Modifier and TypeField and Description
public static final InternalFlags.NullableProvidesOption
ERROR

Error if null parameters are passed to non-@Nullable parameters of provides parameters

public static final InternalFlags.NullableProvidesOption
IGNORE

Ignore null parameters to @Provides methods.

public static final InternalFlags.NullableProvidesOption
WARN

Warn if null parameters are passed to non-@Nullable parameters of provides methods.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static InternalFlags.NullableProvidesOption
public static InternalFlags.NullableProvidesOption[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ERRORback to summary
public static final InternalFlags.NullableProvidesOption ERROR

Error if null parameters are passed to non-@Nullable parameters of provides parameters

IGNOREback to summary
public static final InternalFlags.NullableProvidesOption IGNORE

Ignore null parameters to @Provides methods.

WARNback to summary
public static final InternalFlags.NullableProvidesOption WARN

Warn if null parameters are passed to non-@Nullable parameters of provides methods.

Constructor Detail

NullableProvidesOptionback to summary
private NullableProvidesOption()

Method Detail

valueOfback to summary
public static InternalFlags.NullableProvidesOption valueOf(String name)
valuesback to summary
public static InternalFlags.NullableProvidesOption[] values()