Class LocatedException

  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    CompileException

    public class LocatedException
    extends java.lang.Exception
    An Exception that is associated with an optional Location in a source file.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      LocatedException​(java.lang.String message, Location optionalLocation)  
      LocatedException​(java.lang.String message, Location optionalLocation, java.lang.Throwable optionalCause)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Location getLocation()  
      java.lang.String getMessage()
      Returns the message specified at creation time, preceeded with nicely formatted location information (if any).
      • Methods inherited from class java.lang.Throwable

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

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

      • optionalLocation

        private final Location optionalLocation
    • Constructor Detail

      • LocatedException

        public LocatedException​(java.lang.String message,
                                Location optionalLocation)
      • LocatedException

        public LocatedException​(java.lang.String message,
                                Location optionalLocation,
                                java.lang.Throwable optionalCause)
    • Method Detail

      • getMessage

        public java.lang.String getMessage()
        Returns the message specified at creation time, preceeded with nicely formatted location information (if any).
        Overrides:
        getMessage in class java.lang.Throwable
      • getLocation

        public Location getLocation()
        Returns:
        The Location specified at construction time (may be null)