edu.umd.cfar.lamp.viper.util
Class BadDataException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byedu.umd.cfar.lamp.viper.util.BadDataException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ImproperDescriptorException

public class BadDataException
extends java.lang.Exception

This is thrown when the information entered from a file into an attribute's value field does not conform. For example, setting a bbox to "false". If you are passing a parse error, please set the character offset for the ErrorWriter, as it helps it find the error on multiline files.

See Also:
CountingStringTokenizer, VReader, Serialized Form

Constructor Summary
BadDataException()
          Constructs a new BadDataException with no message.
BadDataException(java.lang.String s)
          Constructs a new BadDataException with the given message.
BadDataException(java.lang.String s, int startCharacter, int endCharacter)
          Constructs a new BadDataException with the given message and indicates where in the line is the erroneous text.
 
Method Summary
 int getEnd()
          Gets the last character offset.
 int getStart()
          Gets the first character offset.
 boolean isChar()
          Determines if the error message contains data about where the error occurred.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BadDataException

public BadDataException()
Constructs a new BadDataException with no message.


BadDataException

public BadDataException(java.lang.String s)
Constructs a new BadDataException with the given message.

Parameters:
s - The detail message.

BadDataException

public BadDataException(java.lang.String s,
                        int startCharacter,
                        int endCharacter)
Constructs a new BadDataException with the given message and indicates where in the line is the erroneous text.

Parameters:
s - The detail message.
startCharacter - The offset of the first character. If set up properly, the theory is that emacs could put your cursor here.
endCharacter - The last character. In theory, a good ErrorWriter could then underline the error, like jikes does.
Method Detail

isChar

public boolean isChar()
Determines if the error message contains data about where the error occurred.

Returns:
true if there is offset info.

getStart

public int getStart()
Gets the first character offset.

Returns:
The offset of the first character.

getEnd

public int getEnd()
Gets the last character offset.

Returns:
The offset of the last character.