public static final class Framework.FrameworkBuilder
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
Framework |
build()
Compile all the user-set options into an instance of Framework
NOTE: Will crash if any of the following aren't set:
- main
- pckg
|
Framework.FrameworkBuilder |
commandPrefix(java.lang.String commandPrefix)
The application's command prefix, to be used in command handlers.
|
Framework.FrameworkBuilder |
config(java.lang.Class<?> addon,
java.lang.String config,
java.util.Map<java.lang.String,java.lang.String> locations)
Configure a config for an addon that requires configuration.
|
Framework.FrameworkBuilder |
customLang(java.lang.String config,
LangEnum[] values)
Specify a custom language enum
|
Framework.FrameworkBuilder |
debug(boolean debug)
Should debug messages be logged?
|
Framework.FrameworkBuilder |
file(boolean config,
java.lang.String name,
FileData.ConfigPathReference internalPath,
java.lang.String externalPath,
java.lang.annotation.Annotation annotation)
Add a file to be copied from an embed and loaded into memory.
|
Framework.FrameworkBuilder |
file(boolean config,
java.lang.String name,
FileData.ConfigPathReference internalPath,
java.lang.String externalPath,
java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
Add a file to be copied from an embed and loaded into memory.
|
Framework.FrameworkBuilder |
file(boolean config,
java.lang.String name,
java.lang.String internalPath,
java.lang.String externalPath,
java.lang.annotation.Annotation annotation)
Add a file to be copied from an embed and loaded into memory.
|
Framework.FrameworkBuilder |
file(boolean config,
java.lang.String name,
java.lang.String internalPath,
java.lang.String externalPath,
java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
Add a file to be copied from an embed and loaded into memory.
|
Framework.FrameworkBuilder |
fileDir(java.lang.String dir)
Set the parent directory configs will be put in.
|
Framework.FrameworkBuilder |
injector(com.google.inject.Injector injector)
Set the application's initial injector, if one is already made.
|
Framework.FrameworkBuilder |
langConfig(java.lang.String config,
java.util.Map<java.lang.String,java.lang.String> locations)
If useLangFile is set to true, optionally use your own config with mappings.
|
Framework.FrameworkBuilder |
main(java.lang.Class<?> clazz,
java.lang.Object instance)
Set the application's main instance
|
Framework.FrameworkBuilder |
main(java.lang.Object instance)
Set the application's main instance
|
Framework.FrameworkBuilder |
overrideLangFile(boolean value)
Declare whether a lang file will be used over hardcoded values.
|
Framework.FrameworkBuilder |
pckg(java.lang.String pckg,
java.lang.String... exclusions)
Set the application's package which will be scanned,
and optionally any sub packages to exclude.
|
Framework.FrameworkBuilder |
shutdown(java.lang.Class<? extends ShutdownRegisterable>... registerables)
Add shutdown registerables to be ran in the shutdown hook, in order.
|
Framework.FrameworkBuilder |
startup(RegisterableData... registerables)
Add startup registerables to be ran in the bootstrap, in order.
|
Framework.FrameworkBuilder |
threads(int threads)
Set the amount of threads that will be available via the default task manager's thread pol
|
public final Framework.FrameworkBuilder main(java.lang.Object instance)
instance - Main instancepublic final Framework.FrameworkBuilder main(java.lang.Class<?> clazz, java.lang.Object instance)
clazz - Class to bind the instance under, for example, in bukkit,
you'd enter JavaPlugin.classinstance - Main instancepublic final Framework.FrameworkBuilder pckg(java.lang.String pckg, java.lang.String... exclusions)
pckg - Application's packageexclusions - Packages to be excludedpublic final Framework.FrameworkBuilder injector(com.google.inject.Injector injector)
injector - Application's injectorpublic final Framework.FrameworkBuilder startup(RegisterableData... registerables)
registerables - Varargs classes extending StartupRegisterable@SafeVarargs public final Framework.FrameworkBuilder shutdown(java.lang.Class<? extends ShutdownRegisterable>... registerables)
registerables - Varargs classes extending ShutdownRegisterablepublic final Framework.FrameworkBuilder commandPrefix(java.lang.String commandPrefix)
commandPrefix - Stringpublic final Framework.FrameworkBuilder file(boolean config, java.lang.String name, java.lang.String internalPath, java.lang.String externalPath, java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
config - Should this file be stored as a FileConfigurationname - Name of the file to be referenced in FileManagerinternalPath - The hard internal path of the file.externalPath - The external path of the file, set to null if file shouldn't be copied
outside the jar.annotation - Annotation class to bind the instance to.public final Framework.FrameworkBuilder file(boolean config, java.lang.String name, java.lang.String internalPath, java.lang.String externalPath, java.lang.annotation.Annotation annotation)
config - Should this file be stored as a FileConfigurationname - Name of the file to be referenced in FileManagerinternalPath - The hard internal path of the file.externalPath - The external path of the file, set to null if file shouldn't be copied
outside the jar.annotation - Annotation instance to bind the instance to.public final Framework.FrameworkBuilder file(boolean config, java.lang.String name, FileData.ConfigPathReference internalPath, java.lang.String externalPath, java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
config - Should this file be stored as a FileConfigurationname - Name of the file to be referenced in FileManagerinternalPath - The dynamic internal path of the file.externalPath - The external path of the file, set to null if file shouldn't be copied
outside the jar.annotation - Annotation class to bind the instance to.public final Framework.FrameworkBuilder file(boolean config, java.lang.String name, FileData.ConfigPathReference internalPath, java.lang.String externalPath, java.lang.annotation.Annotation annotation)
config - Should this file be stored as a FileConfigurationname - Name of the file to be referenced in FileManagerinternalPath - The dynamic internal path of the file.externalPath - The external path of the file, set to null if file shouldn't be copied
outside the jar.annotation - Annotation instance to bind the instance to.public final Framework.FrameworkBuilder threads(int threads)
threads - Amount of threadspublic final Framework.FrameworkBuilder config(java.lang.Class<?> addon, java.lang.String config, java.util.Map<java.lang.String,java.lang.String> locations)
addon - Addon to configureconfig - String reference to config in FileManagerlocations - Locations of the values the addon needspublic final Framework.FrameworkBuilder fileDir(java.lang.String dir)
dir - Path of the directorypublic final Framework.FrameworkBuilder overrideLangFile(boolean value)
value - True or falsepublic final Framework.FrameworkBuilder langConfig(java.lang.String config, java.util.Map<java.lang.String,java.lang.String> locations)
config - Config namelocations - Mappingpublic final Framework.FrameworkBuilder customLang(java.lang.String config, LangEnum[] values)
config - Config identifiervalues - Values of the enumpublic final Framework.FrameworkBuilder debug(boolean debug)
debug - True/falsepublic final Framework build()