org.hecl
Class HeclException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- org.hecl.HeclException
-
- All Implemented Interfaces:
- java.io.Serializable
public class HeclException extends java.lang.ExceptionTheHeclExceptionclass implements exceptions for Hecl.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description java.lang.Stringcode
-
Constructor Summary
Constructors Constructor and Description HeclException(java.lang.String s)Creates a newHeclExceptioninstance.HeclException(java.lang.String s, int lineno)HeclException(java.lang.String s, java.lang.String exception_code)Creates a newHeclExceptioninstance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static java.lang.StringBufferargvToString(Thing[] argv)TheargvToStringmethod turns an argv array into a string, suitable for printing in error messages.static java.lang.StringBufferargvToString(Thing[] argv, int count)TheargvToStringmethod turns an argv array into a string, suitable for printing in error messages.static HeclExceptioncreateInvalidParameter(Thing param, java.lang.String type, java.lang.String options)static HeclExceptioncreateWrongNumArgsException(Thing[] argv, int count, java.lang.String message)ThecreateWrongNumArgsExceptionmethod creates a HeclException for a command that has received the wrong number of arguments.ThinggetStack()ThegetStackmethod returns the exception as a Thing.voidsetLine(int lineno)ThesetLinemethod sets the line number of an error.java.lang.StringtoString()ThetoStringmethod turns the exception stack into a string.voidwhere(java.lang.String cmd, int lineno)Thewheremethod tells the exception what command it occurred in.
-
-
-
Constructor Detail
-
HeclException
public HeclException(java.lang.String s)
Creates a newHeclExceptioninstance.- Parameters:
s- aStringvalue
-
HeclException
public HeclException(java.lang.String s, int lineno)
-
HeclException
public HeclException(java.lang.String s, java.lang.String exception_code)Creates a newHeclExceptioninstance.- Parameters:
s- aStringvalue describing the error.exception_code- anintvalue
-
-
Method Detail
-
where
public void where(java.lang.String cmd, int lineno)Thewheremethod tells the exception what command it occurred in.- Parameters:
cmd- aStringcontaining the command name.
-
toString
public java.lang.String toString()
ThetoStringmethod turns the exception stack into a string.- Overrides:
toStringin classjava.lang.Throwable- Returns:
- a
Stringvalue
-
getStack
public Thing getStack()
ThegetStackmethod returns the exception as a Thing.- Returns:
- a
Thingvalue
-
argvToString
public static java.lang.StringBuffer argvToString(Thing[] argv)
TheargvToStringmethod turns an argv array into a string, suitable for printing in error messages.- Parameters:
argv- aThingvalue- Returns:
- a
StringBuffervalue
-
argvToString
public static java.lang.StringBuffer argvToString(Thing[] argv, int count)
TheargvToStringmethod turns an argv array into a string, suitable for printing in error messages.- Parameters:
argv- aThingvaluecount- aThingvalue- Returns:
- a
StringBuffervalue
-
createWrongNumArgsException
public static HeclException createWrongNumArgsException(Thing[] argv, int count, java.lang.String message) throws HeclException
ThecreateWrongNumArgsExceptionmethod creates a HeclException for a command that has received the wrong number of arguments.- Parameters:
argv- aThingvaluecount- anintvaluemessage- aStringvalue- Returns:
- a
HeclExceptionvalue - Throws:
HeclException- if an error occurs
-
createInvalidParameter
public static HeclException createInvalidParameter(Thing param, java.lang.String type, java.lang.String options) throws HeclException
- Parameters:
param-Thingspecifying the actual parameter.type- String saying the type - ie option , command .options- A comma-separated list of options that can be supplied.- Returns:
- a new HeclException
- Throws:
HeclException
-
setLine
public void setLine(int lineno) throws HeclExceptionThesetLinemethod sets the line number of an error. FIXME - this could probably be done in a cleaner way...- Parameters:
lineno- anintvalue- Throws:
HeclException- if an error occurs
-
-
DataMelt 3.0 © DataMelt by jWork.ORG