org.nlogo.api
Class CompilerException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by org.nlogo.api.CompilerException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
SliderConstraint.ConstraintCompilerException

public class CompilerException
extends Exception

Exception thrown by various methods that accept NetLogo code as input and cause that code to be compiled; indicates the code was invalid. May be inspected to discover the location and nature of the error.

See Also:
Serialized Form

Field Summary
static String RUNTIME_ERROR_AT_COMPILE_TIME_MSG_PREFIX
           
 
Constructor Summary
CompilerException(String message, int startPos, int endPos, String fileName)
           
 
Method Summary
 int getEndPosition()
          Returns the index of the end of the portion of the code in which the error was found.
 String getFileName()
           
 int getOffset()
           
 int getStartPosition()
          Returns the index of the start of the portion of the code in which the error was found.
 void setOffset(int offset)
           
 String toString()
          Synonymous with getDescription().
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RUNTIME_ERROR_AT_COMPILE_TIME_MSG_PREFIX

public static final String RUNTIME_ERROR_AT_COMPILE_TIME_MSG_PREFIX
See Also:
Constant Field Values
Constructor Detail

CompilerException

public CompilerException(String message,
                         int startPos,
                         int endPos,
                         String fileName)
Method Detail

getStartPosition

public int getStartPosition()
Returns the index of the start of the portion of the code in which the error was found.


getEndPosition

public int getEndPosition()
Returns the index of the end of the portion of the code in which the error was found.


getOffset

public int getOffset()

setOffset

public void setOffset(int offset)

getFileName

public String getFileName()

toString

public String toString()
Synonymous with getDescription().

Overrides:
toString in class Throwable