Class ParseUnexpectedDataException

    • Constructor Summary

      Constructors 
      Constructor Description
      ParseUnexpectedDataException​(char expectedChar, char foundChar, long lineIndex, long charIndex)
      Constructor for an unexpected character error, when one character was expected.
      ParseUnexpectedDataException​(char foundChar, long lineIndex, long charIndex)
      Constructor for an unexpected character error.
      ParseUnexpectedDataException​(Characters expectedChars, char foundChar, long lineIndex, long charIndex)
      Constructor for an unexpected character error, when multiple characters were expected.
      ParseUnexpectedDataException​(java.io.Reader reader, char foundChar)
      Constructor for an unexpected character error from a parse reader.
      ParseUnexpectedDataException​(java.io.Reader reader, char expectedChar, char foundChar)
      Constructor for an unexpected character error from a parse reader, when one character was expected.
      ParseUnexpectedDataException​(java.io.Reader reader, Characters expectedChars, char foundChar)
      Constructor for an unexpected character error from a parse reader, when multiple characters were expected.
      ParseUnexpectedDataException​(java.io.Reader reader, java.lang.String message, char foundChar)
      Constructor for an unexpected character error from a parse reader.
      ParseUnexpectedDataException​(java.io.Reader reader, java.lang.String message, char expectedChar, char foundChar)
      Constructor for an unexpected character error from a parse reader, when one character was expected.
      ParseUnexpectedDataException​(java.lang.String[] expectedStrings, java.lang.String foundString, long lineIndex, long charIndex, java.lang.String sourceName)
      Constructor for an unexpected character error, when multiple strings were expected.
      ParseUnexpectedDataException​(java.lang.String message, char expectedChar, char foundChar, long lineIndex, long charIndex)
      Constructor for an unexpected character error, when one character was expected.
      ParseUnexpectedDataException​(java.lang.String message, char foundChar, long lineIndex, long charIndex)
      Constructor for an unexpected character error.
    • Constructor Detail

      • ParseUnexpectedDataException

        public ParseUnexpectedDataException​(java.io.Reader reader,
                                            char foundChar)
        Constructor for an unexpected character error from a parse reader.
        Parameters:
        reader - The reader the data of which is the source of the error.
        foundChar - The character found at this location.
      • ParseUnexpectedDataException

        public ParseUnexpectedDataException​(java.io.Reader reader,
                                            java.lang.String message,
                                            char foundChar)
        Constructor for an unexpected character error from a parse reader.
        Parameters:
        reader - The reader the data of which is the source of the error.
        message - The error message, or null if there is no error message.
        foundChar - The character found at this location.
      • ParseUnexpectedDataException

        public ParseUnexpectedDataException​(char foundChar,
                                            long lineIndex,
                                            long charIndex)
        Constructor for an unexpected character error.
        Parameters:
        foundChar - The character found at this location.
        lineIndex - The index of the line in which the error occurred.
        charIndex - The index of the character at which the error occurred on the current line.
      • ParseUnexpectedDataException

        public ParseUnexpectedDataException​(java.lang.String message,
                                            char foundChar,
                                            long lineIndex,
                                            long charIndex)
        Constructor for an unexpected character error.
        Parameters:
        message - The error message, or null if there is no error message.
        foundChar - The character found at this location.
        lineIndex - The index of the line in which the error occurred.
        charIndex - The index of the character at which the error occurred on the current line.
      • ParseUnexpectedDataException

        public ParseUnexpectedDataException​(java.io.Reader reader,
                                            char expectedChar,
                                            char foundChar)
        Constructor for an unexpected character error from a parse reader, when one character was expected.
        Parameters:
        reader - The reader the data of which is the source of the error.
        expectedChar - The character expected at this location.
        foundChar - The character found at this location.
      • ParseUnexpectedDataException

        public ParseUnexpectedDataException​(java.io.Reader reader,
                                            java.lang.String message,
                                            char expectedChar,
                                            char foundChar)
        Constructor for an unexpected character error from a parse reader, when one character was expected.
        Parameters:
        reader - The reader the data of which is the source of the error.
        message - The error message, or null if there is no error message.
        expectedChar - The character expected at this location.
        foundChar - The character found at this location.
      • ParseUnexpectedDataException

        public ParseUnexpectedDataException​(char expectedChar,
                                            char foundChar,
                                            long lineIndex,
                                            long charIndex)
        Constructor for an unexpected character error, when one character was expected.
        Parameters:
        expectedChar - The character expected at this location.
        foundChar - The character found at this location.
        lineIndex - The index of the line in which the error occurred.
        charIndex - The index of the character at which the error occurred on the current line.
      • ParseUnexpectedDataException

        public ParseUnexpectedDataException​(java.lang.String message,
                                            char expectedChar,
                                            char foundChar,
                                            long lineIndex,
                                            long charIndex)
        Constructor for an unexpected character error, when one character was expected.
        Parameters:
        message - The error message, or null if there is no error message.
        expectedChar - The character expected at this location.
        foundChar - The character found at this location.
        lineIndex - The index of the line in which the error occurred.
        charIndex - The index of the character at which the error occurred on the current line.
      • ParseUnexpectedDataException

        public ParseUnexpectedDataException​(java.io.Reader reader,
                                            Characters expectedChars,
                                            char foundChar)
        Constructor for an unexpected character error from a parse reader, when multiple characters were expected.
        Parameters:
        reader - The reader the data of which is the source of the error.
        expectedChars - The characters expected at this location.
        foundChar - The character found at this location.
      • ParseUnexpectedDataException

        public ParseUnexpectedDataException​(Characters expectedChars,
                                            char foundChar,
                                            long lineIndex,
                                            long charIndex)
        Constructor for an unexpected character error, when multiple characters were expected.
        Parameters:
        expectedChars - The characters expected at this location.
        foundChar - The character found at this location.
        lineIndex - The index of the line in which the error occurred.
        charIndex - The index of the character at which the error occurred on the current line.
      • ParseUnexpectedDataException

        public ParseUnexpectedDataException​(java.lang.String[] expectedStrings,
                                            java.lang.String foundString,
                                            long lineIndex,
                                            long charIndex,
                                            java.lang.String sourceName)
        Constructor for an unexpected character error, when multiple strings were expected.
        Parameters:
        expectedStrings - An array containing the strings expected at this location.
        foundString - The string found at this location.
        lineIndex - The index of the line in which the error occurred.
        charIndex - The index of the character at which the error occurred on the current line.
        sourceName - The name of the source of the data (perhaps a filename).
    • Method Detail

      • getExpectedCharacters

        public java.util.Optional<Characters> getExpectedCharacters()
        Returns:
        The expected characters, if characters were expected.
      • setExpectedCharacters

        protected void setExpectedCharacters​(@Nonnull
                                             Characters expectedCharacters)
        Sets the expected characters.
        Parameters:
        expectedCharacters - The expected characters.
      • getFoundCharacter

        public char getFoundCharacter()
        Returns:
        The character found, if characters were expected, else 0.
      • setFoundCharacter

        protected void setFoundCharacter​(char foundCharacter)
        Sets the character found.
        Parameters:
        foundCharacter - The character found.
      • getExpectedStrings

        public java.util.Optional<java.util.List<java.lang.String>> getExpectedStrings()
        Returns:
        The expected strings, if strings were expected.
      • setExpectedStrings

        protected void setExpectedStrings​(@Nonnull
                                          java.util.List<java.lang.String> expectedStrings)
        Sets the expected strings.
        Parameters:
        expectedStrings - The expected strings.
      • getFoundString

        public java.util.Optional<java.lang.String> getFoundString()
        Returns:
        The string found, if strings were expected.
      • setFoundString

        protected void setFoundString​(@Nonnull
                                      java.lang.String foundString)
        Sets the string found.
        Parameters:
        foundString - The string found.
      • getExpectedMessage

        public java.lang.String getExpectedMessage()
        Returns a message with the expected data, either a list of characters or a list of strings.
        Returns:
        A message with the expected data.
      • getFoundMessage

        public java.lang.String getFoundMessage()
        Returns a message with the data found, either a single character or a string.
        Returns:
        A message with the data found.