org.tridas.io.exceptions
Class InvalidDendroFileException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by org.tridas.io.exceptions.InvalidDendroFileException
All Implemented Interfaces:
Serializable

public class InvalidDendroFileException
extends Exception

This is thrown when a fatal error is found in the input dendro data file. The reason for the error is given along with the line number.

Author:
peterbrewer
See Also:
Serialized Form

Nested Class Summary
static class InvalidDendroFileException.PointerType
           
 
Constructor Summary
InvalidDendroFileException(String reason)
          Constructor for this exception when there is no specific position in the file where the error occurred e.g.
InvalidDendroFileException(String reason, int linenumber)
          Constructor for this exception when providing line number of erroneous input file
InvalidDendroFileException(String reason, int pointernumber, InvalidDendroFileException.PointerType type)
          Construct an exception.
InvalidDendroFileException(String reason, String pointervalue, InvalidDendroFileException.PointerType type)
          Construct an exception.
 
Method Summary
 String getLocalizedMessage()
           
 String getPointerNumber()
          Get the line or byte number of the dendro file where this exception occurred
 InvalidDendroFileException.PointerType getPointerType()
           
 String getReason()
          Get the reason for this exception
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, 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

InvalidDendroFileException

public InvalidDendroFileException(String reason)
Constructor for this exception when there is no specific position in the file where the error occurred e.g. no data in file.

Parameters:
reason -

InvalidDendroFileException

public InvalidDendroFileException(String reason,
                                  int linenumber)
Constructor for this exception when providing line number of erroneous input file

Parameters:
reason -
linenumber -

InvalidDendroFileException

public InvalidDendroFileException(String reason,
                                  int pointernumber,
                                  InvalidDendroFileException.PointerType type)
Construct an exception. Requires a reason, a counter (either line or byte) to say whereabouts in the input file the error occurred, and a PointerType to say whether the counter is a line or byte count.

Parameters:
reason -
pointernumber -
type -

InvalidDendroFileException

public InvalidDendroFileException(String reason,
                                  String pointervalue,
                                  InvalidDendroFileException.PointerType type)
Construct an exception. Requires a reason, a pointer value (line number, cell ref etc) to say whereabouts in the input file the error occurred, and a PointerType to say whether the counter is a line, byte or cell reference.

Parameters:
reason -
pointervalue -
type -
Method Detail

getPointerNumber

public String getPointerNumber()
Get the line or byte number of the dendro file where this exception occurred

Returns:
the pointernumber

getReason

public String getReason()
Get the reason for this exception

Returns:
the reason

getPointerType

public InvalidDendroFileException.PointerType getPointerType()
Returns:
the pointerType

getLocalizedMessage

public String getLocalizedMessage()
Overrides:
getLocalizedMessage in class Throwable


Copyright © 2011. All Rights Reserved.