Documentation of 'org.hecl.HeclException' Java class
HeclException
org.hecl

Class HeclException

  • All Implemented Interfaces:
    java.io.Serializable


    public class HeclException
    extends java.lang.Exception
    The HeclException class implements exceptions for Hecl.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      java.lang.String code 
    • Constructor Summary

      Constructors 
      Constructor and Description
      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

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      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

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • code

        public java.lang.String code
    • Constructor Detail

      • HeclException

        public HeclException(java.lang.String s)
        Creates a new HeclException instance.
        Parameters:
        s - a String value
      • HeclException

        public HeclException(java.lang.String s,
                             int lineno)
      • HeclException

        public HeclException(java.lang.String s,
                             java.lang.String exception_code)
        Creates a new HeclException instance.
        Parameters:
        s - a String value describing the error.
        exception_code - an int value
    • Method Detail

      • where

        public void where(java.lang.String cmd,
                          int lineno)
        The where method tells the exception what command it occurred in.
        Parameters:
        cmd - a String containing the command name.
      • toString

        public java.lang.String toString()
        The toString method turns the exception stack into a string.
        Overrides:
        toString in class java.lang.Throwable
        Returns:
        a String value
      • getStack

        public Thing getStack()
        The getStack method returns the exception as a Thing.
        Returns:
        a Thing value
      • argvToString

        public static java.lang.StringBuffer argvToString(Thing[] argv)
        The argvToString method turns an argv array into a string, suitable for printing in error messages.
        Parameters:
        argv - a Thing value
        Returns:
        a StringBuffer value
      • argvToString

        public 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.
        Parameters:
        argv - a Thing value
        count - a Thing value
        Returns:
        a StringBuffer value
      • createWrongNumArgsException

        public static HeclException createWrongNumArgsException(Thing[] argv,
                                                                int count,
                                                                java.lang.String message)
                                                         throws HeclException
        The createWrongNumArgsException method creates a HeclException for a command that has received the wrong number of arguments.
        Parameters:
        argv - a Thing value
        count - an int value
        message - a String value
        Returns:
        a HeclException value
        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 - Thing specifying 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 HeclException
        The setLine method sets the line number of an error. FIXME - this could probably be done in a cleaner way...
        Parameters:
        lineno - an int value
        Throws:
        HeclException - if an error occurs

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.