Class GuiceBuilder
java.lang.Object
com.peterphi.std.guice.apploader.impl.GuiceBuilder
Build the specifications for a new guice framework environment
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.google.inject.Injectorbuild()Instantiate the guice environment.static GuiceBuilderConstruct a GuiceBuilder with sensible defaults for testingstatic GuiceBuilderforTesting(com.google.inject.Module... modules) Construct a GuiceBuilder with sensible defaults for testing.booleanwithAutoLoadProperties(boolean autoLoadProperties) withAutoLoadRoles(boolean autoLoadRoles) withClassloader(ClassLoader classloader) withConfig(PropertyFile... props) withConfig(String... filenames) withConfig(Properties... configs) withRegistry(GuiceRegistry registry) withScannerFactory(ClassScannerFactory scannerFactory) withSetup(GuiceSetup setup) withSetup(Class<? extends GuiceSetup> clazz)
-
Constructor Details
-
GuiceBuilder
public GuiceBuilder()
-
-
Method Details
-
withRegistry
-
withScannerFactory
-
withNoScannerFactory
-
withRole
-
withAutoLoadRoles
-
withConfig
-
withConfig
-
withConfig
-
withSetup
-
withSetup
-
withClassloader
-
withAutoLoadProperties
-
isAutoLoadProperties
public boolean isAutoLoadProperties() -
build
public com.google.inject.Injector build()Instantiate the guice environment. For information on what's involved in this process seeGuiceFactory.build(GuiceRegistry, ClassScannerFactory, List, List, GuiceSetup, boolean, boolean, ClassLoader)andGuiceFactory.createInjector(GuiceRegistry, ClassScannerFactory, GuiceConfig, GuiceSetup, List)- Returns:
-
forTesting
Construct a GuiceBuilder with sensible defaults for testing- Returns:
-
forTesting
Construct a GuiceBuilder with sensible defaults for testing. Adds the provided modules (wrapped in aBasicSetupautomatically) to the environment that will be constructed- Parameters:
modules-- Returns:
-