Class SpecParseException

  • All Implemented Interfaces:
    java.io.Serializable

    public class SpecParseException
    extends java.lang.Exception
    Something went wrong while parsing a .spec file.
    Author:
    Raphael Mudge
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.LinkedList errors
      A collection of errors we found
      protected java.lang.String parent
      The .spec file where these errors came from
    • Constructor Summary

      Constructors 
      Constructor Description
      SpecParseException​(crystalpalace.spec.SpecParser p, java.lang.String _parent)
      Construct a new SpecParseException
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List getErrors()
      Get the parsing errors that were discovered while parsing this file.
      java.lang.String getFile()
      Get the file associated with this exception
      java.lang.String getMessage()
      Returns a generic error message string, something like Error(s) parsing [file here].
      java.lang.String toString()
      Convert this exception to a human readable string.
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • errors

        protected java.util.LinkedList errors
        A collection of errors we found
      • parent

        protected java.lang.String parent
        The .spec file where these errors came from
    • Constructor Detail

      • SpecParseException

        public SpecParseException​(crystalpalace.spec.SpecParser p,
                                  java.lang.String _parent)
        Construct a new SpecParseException
        Parameters:
        p - the parser that detected the error
        _parent - the file where the error probably occurred
    • Method Detail

      • getErrors

        public java.util.List getErrors()
        Get the parsing errors that were discovered while parsing this file. Sometimes, there's more than one. Each entry in this java.util.List is a java.lang.String
        Returns:
        a list of errors
      • getMessage

        public java.lang.String getMessage()
        Returns a generic error message string, something like Error(s) parsing [file here]. So exciting.
        Overrides:
        getMessage in class java.lang.Throwable
        Returns:
        a message associated with this exception
      • getFile

        public java.lang.String getFile()
        Get the file associated with this exception
        Returns:
        the parent file value
      • toString

        public java.lang.String toString()
        Convert this exception to a human readable string. It's a multi-line string. If I were using this API, this is the method I would call. Just display this information to the user and they'll figure it out.
        Overrides:
        toString in class java.lang.Throwable
        Returns:
        the parser exception formatted nicely-ish.