Class BodyAutoRegisterHandler
java.lang.Object
de.craftsblock.craftsnet.autoregister.AutoRegisterHandler<BodyParser<? extends Body>>
de.craftsblock.craftsnet.autoregister.builtin.http.BodyAutoRegisterHandler
A handler for automatically registering
BodyParser implementations. This class extends
AutoRegisterHandler and provides a concrete implementation for handling the registration of
BodyParser instances into the body registry of CraftsNet.- Since:
- 3.2.0-SNAPSHOT
-
Field Summary
Fields inherited from class de.craftsblock.craftsnet.autoregister.AutoRegisterHandler
craftsNet -
Constructor Summary
ConstructorsConstructorDescriptionBodyAutoRegisterHandler(CraftsNet craftsNet) Constructs a newBodyAutoRegisterHandler. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanhandle(BodyParser<? extends Body> bodyParser, AutoRegisterInfo info, Object... args) Handles the registration of the providedBodyParser.Methods inherited from class de.craftsblock.craftsnet.autoregister.AutoRegisterHandler
getCraftsNet
-
Constructor Details
-
BodyAutoRegisterHandler
Constructs a newBodyAutoRegisterHandler.- Parameters:
craftsNet- TheCraftsNetinstance used for managing the body registry.
-
-
Method Details
-
handle
protected boolean handle(BodyParser<? extends Body> bodyParser, AutoRegisterInfo info, Object... args) Handles the registration of the providedBodyParser.This method attempts to register the given
BodyParserwith theCraftsNet.getBodyRegistry()of the associatedCraftsNetinstance. If registration is successful, the method returnstrue.- Specified by:
handlein classAutoRegisterHandler<BodyParser<? extends Body>>- Parameters:
bodyParser- TheBodyParserto be registered.args- Additional arguments (not used in this implementation but provided for extensibility).info- TheAutoRegisterInfowhich holds more information about the object.- Returns:
trueif the registration was successful,falseotherwise.
-