|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Throwable
java.lang.Exception
org.hecl.HeclException
public class HeclException
The HeclException class implements exceptions for Hecl.
| Field Summary | |
|---|---|
java.lang.String |
code
|
| Constructor Summary | |
|---|---|
HeclException(java.lang.String s)
Creates a new HeclException instance. |
|
HeclException(java.lang.String s,
int lineno)
|
|
HeclException(java.lang.String s,
java.lang.String exception_code)
Creates a new HeclException instance. |
|
| Method Summary | |
|---|---|
static java.lang.StringBuffer |
argvToString(Thing[] argv)
The argvToString method turns an argv array into a
string, suitable for printing in error messages. |
static java.lang.StringBuffer |
argvToString(Thing[] argv,
int count)
The argvToString method turns an argv array into a
string, suitable for printing in error messages. |
static HeclException |
createInvalidParameter(Thing param,
java.lang.String type,
java.lang.String options)
|
static HeclException |
createWrongNumArgsException(Thing[] argv,
int count,
java.lang.String message)
The createWrongNumArgsException method creates a
HeclException for a command that has received the wrong number
of arguments. |
Thing |
getStack()
The getStack method returns the exception as a Thing. |
void |
setLine(int lineno)
The setLine method sets the line number of an
error. |
java.lang.String |
toString()
The toString method turns the exception stack into a
string. |
void |
where(java.lang.String cmd,
int lineno)
The where method tells the exception what command it
occurred in. |
| Methods inherited from class java.lang.Throwable |
|---|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public java.lang.String code
| Constructor Detail |
|---|
public HeclException(java.lang.String s)
HeclException instance.
s - a String value
public HeclException(java.lang.String s,
int lineno)
public HeclException(java.lang.String s,
java.lang.String exception_code)
HeclException instance.
s - a String value describing the error.exception_code - an int value| Method Detail |
|---|
public void where(java.lang.String cmd,
int lineno)
where method tells the exception what command it
occurred in.
cmd - a String containing the command name.public java.lang.String toString()
toString method turns the exception stack into a
string.
toString in class java.lang.ThrowableString valuepublic Thing getStack()
getStack method returns the exception as a Thing.
Thing valuepublic static java.lang.StringBuffer argvToString(Thing[] argv)
argvToString method turns an argv array into a
string, suitable for printing in error messages.
argv - a Thing value
StringBuffer value
public static java.lang.StringBuffer argvToString(Thing[] argv,
int count)
argvToString method turns an argv array into a
string, suitable for printing in error messages.
argv - a Thing valuecount - a Thing value
StringBuffer value
public static HeclException createWrongNumArgsException(Thing[] argv,
int count,
java.lang.String message)
throws HeclException
createWrongNumArgsException method creates a
HeclException for a command that has received the wrong number
of arguments.
argv - a Thing valuecount - an int valuemessage - a String value
HeclException value
HeclException - if an error occurs
public static HeclException createInvalidParameter(Thing param,
java.lang.String type,
java.lang.String options)
throws HeclException
param - Thing specifying the actual parameter.type - String saying the type - ie option , command .options - A comma-separated list of options that can be supplied.
HeclException
public void setLine(int lineno)
throws HeclException
setLine method sets the line number of an
error. FIXME - this could probably be done in a cleaner way...
lineno - an int value
HeclException - if an error occurs
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||