Class AutoRegisterHandler<T>
java.lang.Object
de.craftsblock.craftsnet.autoregister.AutoRegisterHandler<T>
- Direct Known Subclasses:
BodyAutoRegisterHandler,HandlerAutoRegisterHandler,ListenerAutoRegisterHandler,LogStreamMutatorAutoRegisterHandler,MiddlewareAutoRegisterHandler,ServiceLoaderAutoRegisterHandler,StreamEncoderAutoRegisterHandler,WebRequirementAutoRegisterHandler,WebSocketExtensionAutoRegisterHandler,WebSocketRequirementAutoRegisterHandler,WebSocketTypeDecoderAutoRegisterHandler,WebSocketTypeEncoderAutoRegisterHandler
The
AutoRegisterHandler class is an abstract base class designed to handle objects
during the auto registration process. Each handler is responsible for processing a specific type of object
in the auto register system.
Handlers extend this class and implement the handle(Object, AutoRegisterInfo, Object...) method to define how
the auto register process should interact with the specific type AutoRegisterHandler. The handler also has access to
the CraftsNet instance, which can be used to interact with the main application context.
- Since:
- 3.2.0-SNAPSHOT
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAutoRegisterHandler(CraftsNet craftsNet) Constructs anAutoRegisterHandlerwith the specifiedCraftsNetinstance. -
Method Summary
Modifier and TypeMethodDescriptionGets theCraftsNetinstance associated with this handler.protected abstract booleanhandle(T t, AutoRegisterInfo info, Object... args) Handles the provided objectAutoRegisterHandlerduring the auto registration process.
-
Field Details
-
craftsNet
-
-
Constructor Details
-
AutoRegisterHandler
Constructs anAutoRegisterHandlerwith the specifiedCraftsNetinstance.- Parameters:
craftsNet- The mainCraftsNetinstance, which provides access to the application's context.
-
-
Method Details
-
handle
Handles the provided objectAutoRegisterHandlerduring the auto registration process. This method must be implemented by subclasses to define the specific logic for handling objects of typeAutoRegisterHandler.- Parameters:
t- The object to handle.info- TheAutoRegisterInfowhich holds more information about the object.args- Additional arguments that may be passed during the registration process.- Returns:
trueif the object was handled successfully,falseotherwise.
-
getCraftsNet
Gets theCraftsNetinstance associated with this handler.- Returns:
- The
CraftsNetinstance.
-