Interface AnnotationInjector<S extends Source>

Type Parameters:
S - the type of the command source (e.g., console, player, etc.)
All Known Subinterfaces:
Imperat<S>
All Known Implementing Classes:
BaseImperat

public interface AnnotationInjector<S extends Source>
This interface provides mechanisms for injecting and managing annotations within a command parsing and execution framework. It is designed to allow the registration and replacement of annotations and provides the capability to set a custom AnnotationParser.
  • Method Details

    • getAnnotationParser

      AnnotationParser<S> getAnnotationParser()
      Fetches the annotation parser
      Returns:
      the annotation parser instance.
      See Also:
    • setAnnotationParser

      @Contract("null->fail") void setAnnotationParser(AnnotationParser<S> parser)
      Changes the instance of AnnotationParser
      Parameters:
      parser - the parser
    • registerAnnotations

      void registerAnnotations(Class<? extends Annotation>... type)
      Registers a valueType of annotations so that it can be detected by AnnotationReader , it's useful as it allows that valueType of annotation to be recognized as a true Imperat-related annotation to be used in something like checking if a CommandParameter is annotated and checks for the annotations it has.
      Parameters:
      type - the valueType of annotation
    • registerAnnotationReplacer

      <A extends Annotation> void registerAnnotationReplacer(Class<A> type, AnnotationReplacer<A> replacer)
      Registers annotation replacer
      Type Parameters:
      A - the valueType of annotation to replace
      Parameters:
      type - the valueType to replace the annotation by
      replacer - the replacer
    • registerThrowableHandler

      default void registerThrowableHandler(Object object)
      Parses the instance's class that contains ExceptionHandler annotation into multiple throwable resolvers to be registered and injected into Imperat
      Parameters:
      object - the annotated class containing the exception handling methods.