Class GuiceExtension
java.lang.Object
io.github.kaktushose.jdac.guice.internal.GuiceExtension
- All Implemented Interfaces:
Extension<GuiceExtensionData>
The implementation of Extension for using Googles Guice as an Instantiator.
Additionally, this extension allows the automatic registration of some types annotated with @Implementation.
For further information please see the docs on @Implementation.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface Extension
Extension.Data -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondataType()voidinit(@Nullable GuiceExtensionData data) Initializes theExtensionwith the providedExtension.Data.voidonStart(JDACommands commands) This method will be called after the framework was fully started, practically at the end ofJDACBuilder.start().Gets a collection ofJDACPropertyProviders thisExtensionprovides.
-
Constructor Details
-
GuiceExtension
public GuiceExtension()
-
-
Method Details
-
init
Description copied from interface:ExtensionInitializes theExtensionwith the providedExtension.Data. Will be called right after jda-commands loaded the Extension.- Specified by:
initin interfaceExtension<GuiceExtensionData>- Parameters:
data- The custom implementation ofExtension.Dataif given by the User. This can be safely cast to the type returned byExtension.dataType().
-
properties
Description copied from interface:ExtensionGets a collection of
JDACPropertyProviders thisExtensionprovides.The
JDACPropertys provided by these providers must have [Property#source()()] set toProperty.Source.EXTENSION!- Specified by:
propertiesin interfaceExtension<GuiceExtensionData>- Returns:
- a collection of
JDACPropertyProviders
-
onStart
Description copied from interface:ExtensionThis method will be called after the framework was fully started, practically at the end ofJDACBuilder.start().- Specified by:
onStartin interfaceExtension<GuiceExtensionData>- Parameters:
commands- the fully initializedJDACommandsinstance.
-
dataType
- Specified by:
dataTypein interfaceExtension<GuiceExtensionData>- Returns:
- the
Classof the customExtension.Dataimplementation or null if the extension doesn't support additional configuration
-