Class ErrorGenerator<G extends GameObject<G,​A,​R>,​A extends MapArchObject<A>,​R extends Archetype<G,​A,​R>>

  • Type Parameters:
    G - the game object type of the object
    A - the map arch object type of the object
    R - the archetype type of the object

    public class ErrorGenerator<G extends GameObject<G,​A,​R>,​A extends MapArchObject<A>,​R extends Archetype<G,​A,​R>>
    extends java.lang.Object
    Generator for SuspiciousMsgChecker related error messages.
    • Constructor Summary

      Constructors 
      Constructor Description
      ErrorGenerator​(@NotNull ErrorCollector<G,​A,​R> errorCollector, G gameObject)
      Creates a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void errorKeywordError​(@NotNull java.lang.String reason)
      Reports a keyword related error.
      void errorMatchAllText()
      Adds a new error message for an '@match *' line with text following the '*'.
      void errorRegEx​(@NotNull java.lang.String message)
      Adds a new error message for an incorrect or suspicious regular expression.
      void errorSyntaxError​(@NotNull java.lang.String reason)
      Reports a general syntax error.
      void setCurrentLine​(@NotNull java.lang.String line)
      Sets the line currently being analyzed.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ErrorGenerator

        public ErrorGenerator​(@NotNull
                              @NotNull ErrorCollector<G,​A,​R> errorCollector,
                              @NotNull
                              G gameObject)
        Creates a new instance.
        Parameters:
        errorCollector - the error collector to which the error messages are added
        gameObject - the game object to which the error messages apply
    • Method Detail

      • setCurrentLine

        public void setCurrentLine​(@NotNull
                                   @NotNull java.lang.String line)
        Sets the line currently being analyzed. It will be used as context for all further error messages. This function may be called multiple times and affects only error messages generated afterwards.
        Parameters:
        line - the line that is currently being analyzed
      • errorRegEx

        public void errorRegEx​(@NotNull
                               @NotNull java.lang.String message)
        Adds a new error message for an incorrect or suspicious regular expression.
        Parameters:
        message - the error reason
      • errorMatchAllText

        public void errorMatchAllText()
        Adds a new error message for an '@match *' line with text following the '*'.
      • errorSyntaxError

        public void errorSyntaxError​(@NotNull
                                     @NotNull java.lang.String reason)
        Reports a general syntax error.
        Parameters:
        reason - the syntax error
      • errorKeywordError

        public void errorKeywordError​(@NotNull
                                      @NotNull java.lang.String reason)
        Reports a keyword related error.
        Parameters:
        reason - the reason