Class TextParser<RECEIVER,​SELF extends TextParser<RECEIVER,​SELF>>

  • All Implemented Interfaces:
    Insertable<RECEIVER,​SELF>, Replaceable<RECEIVER,​SELF>
    Direct Known Subclasses:
    TextCompiler

    public abstract class TextParser<RECEIVER,​SELF extends TextParser<RECEIVER,​SELF>>
    extends ContentHandler<RECEIVER,​SELF>
    • Constructor Detail

      • TextParser

        public TextParser()
    • Method Detail

      • parse

        public java.util.List<java.lang.String> parse​(@Nullable
                                                      RECEIVER receiver)
        Parse the texts for the receiver.
        Parameters:
        receiver - the receiver
        Returns:
        the parsed line
      • parse

        public <V> java.util.List<V> parse​(@Nullable
                                           RECEIVER receiver,
                                           @NotNull
                                           @NotNull java.util.function.BiFunction<RECEIVER,​java.lang.String,​V> compiler)
        Parse the texts for the receiver.
        Type Parameters:
        V - the type of the message
        Parameters:
        receiver - the receiver
        compiler - the compiler
        Returns:
        the parsed line
      • parseLine

        @Nullable
        public @Nullable java.lang.String parseLine​(@Nullable
                                                    RECEIVER receiver)
        Parse the texts as a single line for the receiver.
        Parameters:
        receiver - the receiver
        Returns:
        the parsed line
      • parseLine

        @Nullable
        public <V> V parseLine​(@Nullable
                               RECEIVER receiver,
                               @NotNull
                               @NotNull java.util.function.BiFunction<RECEIVER,​java.lang.String,​V> compiler)
        Parse the texts as a single line for the receiver.
        Type Parameters:
        V - the type of the message
        Parameters:
        receiver - the receiver
        Returns:
        the parsed line
      • handle

        public void handle​(@Nullable
                           RECEIVER receiver,
                           @NotNull
                           @NotNull java.util.function.Consumer<java.lang.String> lineConsumer)