Class JSAPResult

java.lang.Object
com.martiansoftware.jsap.JSAPResult
All Implemented Interfaces:
ExceptionMap

public class JSAPResult extends Object implements ExceptionMap
Encapsulates the results of JSAP's parse() methods. The most basic means of obtaining a parse result from a JSAPResult is the getObject(String) method, but a number of getXXX() methods are provided to make your code more readable and to avoid re-casting.
Author:
Marty Lamb
  • Method Details

    • contains

      public boolean contains(String id)
      Returns true if this JSAPResult contains any results for the specified id. Note that these results may be default values, and thus contains(id) might return true even when the user has not herself supplied the parameter.

      This is just a means to see if there are values to retrieve.

      Parameters:
      id - the ID to check
      Returns:
      true if there are any values in this JSAPResult associated with the specified ID.
    • userSpecified

      public boolean userSpecified(String id)
      Returns true if this JSAPResult contains any user-specified values for the specified id. If this JSAPResult contains default values (or no values) for the specified id, this method returns false.
      Parameters:
      id - the ID to check
      Returns:
      indication of whether the user specified a value for the specified id.
    • addException

      public void addException(String id, Exception exception)
      Adds the specified exception to the exception map. Exceptions are keyed by the ID of the parameters with which they are associated. "General" exceptions not associated with a particular parameter have a null key.
      Specified by:
      addException in interface ExceptionMap
      Parameters:
      id - the unique ID of the parameter with which the specified values are associated.
      exception - the exception to associate with the specified key.
      See Also:
    • getObject

      public Object getObject(String id)
      Returns the first object associated with the specified ID. If more than one object is expected, call getObjectArray() instead.
      Parameters:
      id - the unique ID of the parameter for which the first value is requested
      Returns:
      the first object associated with the specified ID. If more than one object is expected, call getObjectArray() instead.
    • getObjectArray

      public Object[] getObjectArray(String id)
      Returns all values associated with the specified ID. If no values are currently associated with the specified ID, an empty (zero-length) array is returned.
      Parameters:
      id - the unique ID of the parameter for which the values are requested
      Returns:
      all values associated with the specified ID. If no values are currently associated with the specified ID, an empty (zero-length) array is returned.
    • getObjectArray

      public Object[] getObjectArray(String id, Object[] a)
      Returns an array containing all of the values associated with the specified ID. The runtime type of the returned array is that of the specified array. If the list fits in the specified array, it is returned therein. Otherwise, a new array is allocated with the runtime type of the specified array and the size of this list..
      Parameters:
      id - the unique ID of the parameter for which the values are requested
      a - the array into which the elements of the list are to be stored, if it is big enough; otherwise, a new array of the same runtime type is allocated for this purpose.
      Returns:
      an array containing all of the values associated with the specified ID. The runtime type of the returned array is that of the specified array. If the list fits in the specified array, it is returned therein. Otherwise, a new array is allocated with the runtime type of the specified array and the size of this list..
    • getBoolean

      public boolean getBoolean(String id)
      Returns the first boolean value associated with the specified id.
      Parameters:
      id - the id of the boolean value to retrieve
      Returns:
      the boolean value associated with the specified id.
      See Also:
    • getBoolean

      public boolean getBoolean(String id, boolean defaultValue)
      Returns the first boolean value associated with the specified id. If the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.lang.Boolean, the specified default value is returned.
      Parameters:
      id - the id of the boolean value to retrieve
      defaultValue - the value to return if the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.lang.Boolean.
      Returns:
      the first boolean value associated with the specified id. If the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.lang.Boolean, the specified default value is returned.
      See Also:
    • getBooleanArray

      public boolean[] getBooleanArray(String id)
      Returns an array of boolean values associated with the specified id. If the specified id does not exist within this JSAPResult, this method returns an empty array (i.e., array.length==0).
      Parameters:
      id - the id of the boolean value(s) to return.
      Returns:
      an array containing the boolean value(s) associated with the specified id, or an empty array if the specified id does not exist within this JSAPResult.
      See Also:
    • getInt

      public int getInt(String id)
      Returns the first integer value associated with the specified id.
      Parameters:
      id - the id of the integer value to retrieve
      Returns:
      the integer value associated with the specified id.
      See Also:
    • getInt

      public int getInt(String id, int defaultValue)
      Returns the first integer value associated with the specified id. If the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.lang.Integer, the specified default value is returned.
      Parameters:
      id - the id of the boolean value to retrieve
      defaultValue - the value to return if the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.lang.Integer.
      Returns:
      the first integer value associated with the specified id. If the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.lang.Integer, the specified default value is returned.
      See Also:
    • getQualifiedSwitchValue

      public String getQualifiedSwitchValue(String id)
      Returns the string value associated with the specified ID for QualifiedSwitches.
      Parameters:
      id - the unique ID of the parameter for which the value is requested
      Returns:
      the value for the QualifiedSwitch associated with the specified ID or null is no such value is present or the ID does not belong to a QualifiedSwitch
    • getIntArray

      public int[] getIntArray(String id)
      Returns an array of integer values associated with the specified id. If the specified id does not exist within this JSAPResult, this method returns an empty array (i.e., array.length==0).
      Parameters:
      id - the id of the integer value(s) to return.
      Returns:
      an array containing the integer value(s) associated with the specified id, or an empty array if the specified id does not exist within this JSAPResult.
      See Also:
    • getLong

      public long getLong(String id)
      Returns the first long value associated with the specified id.
      Parameters:
      id - the id of the long value to retrieve
      Returns:
      the long value associated with the specified id.
      See Also:
    • getLong

      public long getLong(String id, long defaultValue)
      Returns the first long value associated with the specified id. If the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.lang.Long, the specified default value is returned.
      Parameters:
      id - the id of the long value to retrieve
      defaultValue - the value to return if the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.lang.Long.
      Returns:
      the first long value associated with the specified id. If the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.lang.Long, the specified default value is returned.
      See Also:
    • getLongArray

      public long[] getLongArray(String id)
      Returns an array of long values associated with the specified id. If the specified id does not exist within this JSAPResult, this method returns an empty array (i.e., array.length==0).
      Parameters:
      id - the id of the long value(s) to return.
      Returns:
      an array containing the long value(s) associated with the specified id, or an empty array if the specified id does not exist within this JSAPResult.
      See Also:
    • getByte

      public byte getByte(String id)
      Returns the first byte value associated with the specified id.
      Parameters:
      id - the id of the byte value to retrieve
      Returns:
      the byte value associated with the specified id.
      See Also:
    • getByte

      public byte getByte(String id, byte defaultValue)
      Returns the first byte value associated with the specified id. If the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.lang.Byte, the specified default value is returned.
      Parameters:
      id - the id of the byte value to retrieve
      defaultValue - the value to return if the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.lang.Byte.
      Returns:
      the first byte value associated with the specified id. If the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.lang.Byte, the specified default value is returned.
      See Also:
    • getByteArray

      public byte[] getByteArray(String id)
      Returns an array of byte values associated with the specified id. If the specified id does not exist within this JSAPResult, this method returns an empty array (i.e., array.length==0).
      Parameters:
      id - the id of the byte value(s) to return.
      Returns:
      an array containing the byte value(s) associated with the specified id, or an empty array if the specified id does not exist within this JSAPResult.
      See Also:
    • getChar

      public char getChar(String id)
      Returns the first char value associated with the specified id.
      Parameters:
      id - the id of the char value to retrieve
      Returns:
      the char value associated with the specified id.
      See Also:
    • getChar

      public char getChar(String id, char defaultValue)
      Returns the first char value associated with the specified id. If the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.lang.Character, the specified default value is returned.
      Parameters:
      id - the id of the char value to retrieve
      defaultValue - the value to return if the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.lang.Character.
      Returns:
      the first char value associated with the specified id. If the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.lang.Character, the specified default value is returned.
      See Also:
    • getCharArray

      public char[] getCharArray(String id)
      Returns an array of char values associated with the specified id. If the specified id does not exist within this JSAPResult, this method returns an empty array (i.e., array.length==0).
      Parameters:
      id - the id of the char value(s) to return.
      Returns:
      an array containing the char value(s) associated with the specified id, or an empty array if the specified id does not exist within this JSAPResult.
      See Also:
    • getShort

      public short getShort(String id)
      Returns the first short value associated with the specified id.
      Parameters:
      id - the id of the short value to retrieve
      Returns:
      the short value associated with the specified id.
      See Also:
    • getShort

      public short getShort(String id, short defaultValue)
      Returns the first short value associated with the specified id. If the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.lang.Short, the specified default value is returned.
      Parameters:
      id - the id of the short value to retrieve
      defaultValue - the value to return if the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.lang.Short.
      Returns:
      the first short value associated with the specified id. If the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.lang.Short, the specified default value is returned.
      See Also:
    • getShortArray

      public short[] getShortArray(String id)
      Returns an array of short values associated with the specified id. If the specified id does not exist within this JSAPResult, this method returns an empty array (i.e., array.length==0).
      Parameters:
      id - the id of the short value(s) to return.
      Returns:
      an array containing the short value(s) associated with the specified id, or an empty array if the specified id does not exist within this JSAPResult.
      See Also:
    • getDouble

      public double getDouble(String id)
      Returns the first double value associated with the specified id.
      Parameters:
      id - the id of the double value to retrieve
      Returns:
      the double value associated with the specified id.
      See Also:
    • getDouble

      public double getDouble(String id, double defaultValue)
      Returns the first double value associated with the specified id. If the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.lang.Double, the specified default value is returned.
      Parameters:
      id - the id of the double value to retrieve
      defaultValue - the value to return if the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.lang.Double.
      Returns:
      the first double value associated with the specified id. If the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.lang.Double, the specified default value is returned.
      See Also:
    • getDoubleArray

      public double[] getDoubleArray(String id)
      Returns an array of double values associated with the specified id. If the specified id does not exist within this JSAPResult, this method returns an empty array (i.e., array.length==0).
      Parameters:
      id - the id of the double value(s) to return.
      Returns:
      an array containing the double value(s) associated with the specified id, or an empty array if the specified id does not exist within this JSAPResult.
      See Also:
    • getFloat

      public float getFloat(String id)
      Returns the first float value associated with the specified id.
      Parameters:
      id - the id of the float value to retrieve
      Returns:
      the float value associated with the specified id.
      See Also:
    • getFloat

      public float getFloat(String id, float defaultValue)
      Returns the first float value associated with the specified id. If the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.lang.Float, the specified default value is returned.
      Parameters:
      id - the id of the float value to retrieve
      defaultValue - the value to return if the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.lang.Float.
      Returns:
      the first float value associated with the specified id. If the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.lang.Float, the specified default value is returned.
      See Also:
    • getFloatArray

      public float[] getFloatArray(String id)
      Returns an array of float values associated with the specified id. If the specified id does not exist within this JSAPResult, this method returns an empty array (i.e., array.length==0).
      Parameters:
      id - the id of the float value(s) to return.
      Returns:
      an array containing the float value(s) associated with the specified id, or an empty array if the specified id does not exist within this JSAPResult.
      See Also:
    • getString

      public String getString(String id)
      Returns the first String value associated with the specified id.
      Parameters:
      id - the id of the String value to retrieve
      Returns:
      the String value associated with the specified id.
      See Also:
    • getString

      public String getString(String id, String defaultValue)
      Returns the first String value associated with the specified id. If the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.lang.String, the specified default value is returned.
      Parameters:
      id - the id of the String value to retrieve
      defaultValue - the value to return if the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.lang.String.
      Returns:
      the first String value associated with the specified id. If the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.lang.String, the specified default value is returned.
      See Also:
    • getStringArray

      public String[] getStringArray(String id)
      Returns an array of String values associated with the specified id. If the specified id does not exist within this JSAPResult, this method returns an empty array (i.e., array.length==0).
      Parameters:
      id - the id of the String value(s) to return.
      Returns:
      an array containing the String value(s) associated with the specified id, or an empty array if the specified id does not exist within this JSAPResult.
      See Also:
    • getBigDecimal

      public BigDecimal getBigDecimal(String id)
      Returns the first BigDecimal value associated with the specified id.
      Parameters:
      id - the id of the BigDecimal value to retrieve
      Returns:
      the BigDecimal value associated with the specified id.
      See Also:
    • getBigDecimal

      public BigDecimal getBigDecimal(String id, BigDecimal defaultValue)
      Returns the first BigDecimal value associated with the specified id. If the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.math.BigDecimal, the specified default value is returned.
      Parameters:
      id - the id of the BigDecimal value to retrieve
      defaultValue - the value to return if the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.math.BigDecimal.
      Returns:
      the first BigDecimal value associated with the specified id. If the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.lang.BigDecimal, the specified default value is returned.
      See Also:
    • getBigDecimalArray

      public BigDecimal[] getBigDecimalArray(String id)
      Returns an array of BigDecimal values associated with the specified id. If the specified id does not exist within this JSAPResult, this method returns an empty array (i.e., array.length==0).
      Parameters:
      id - the id of the BigDecimal value(s) to return.
      Returns:
      an array containing the BigDecimal value(s) associated with the specified id, or an empty array if the specified id does not exist within this JSAPResult.
      See Also:
    • getBigInteger

      public BigInteger getBigInteger(String id)
      Returns the first BigInteger value associated with the specified id.
      Parameters:
      id - the id of the BigInteger value to retrieve
      Returns:
      the BigInteger value associated with the specified id.
      See Also:
    • getBigInteger

      public BigInteger getBigInteger(String id, BigInteger defaultValue)
      Returns the first BigInteger value associated with the specified id. If the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.math.BigInteger, the specified default value is returned.
      Parameters:
      id - the id of the BigInteger value to retrieve
      defaultValue - the value to return if the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.math.BigInteger.
      Returns:
      the first boolean value associated with the specified id. If the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.lang.BigInteger, the specified default value is returned.
      See Also:
    • getBigIntegerArray

      public BigInteger[] getBigIntegerArray(String id)
      Returns an array of BigInteger values associated with the specified id. If the specified id does not exist within this JSAPResult, this method returns an empty array (i.e., array.length==0).
      Parameters:
      id - the id of the BigInteger value(s) to return.
      Returns:
      an array containing the BigInteger value(s) associated with the specified id, or an empty array if the specified id does not exist within this JSAPResult.
      See Also:
    • getClass

      public Class getClass(String id)
      Returns the first Class value associated with the specified id.
      Parameters:
      id - the id of the Class value to retrieve
      Returns:
      the Class value associated with the specified id.
      See Also:
    • getClass

      public Class getClass(String id, Class defaultValue)
      Returns the first Class value associated with the specified id. If the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.lang.Class, the specified default value is returned.
      Parameters:
      id - the id of the Class value to retrieve
      defaultValue - the value to return if the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.lang.Class.
      Returns:
      the first Class value associated with the specified id. If the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.lang.Class, the specified default value is returned.
      See Also:
    • getClassArray

      public Class[] getClassArray(String id)
      Returns an array of Class values associated with the specified id. If the specified id does not exist within this JSAPResult, this method returns an empty array (i.e., array.length==0).
      Parameters:
      id - the id of the Class value(s) to return.
      Returns:
      an array containing the Class value(s) associated with the specified id, or an empty array if the specified id does not exist within this JSAPResult.
      See Also:
    • getInetAddress

      public InetAddress getInetAddress(String id)
      Returns the first InetAddress value associated with the specified id.
      Parameters:
      id - the id of the InetAddress value to retrieve
      Returns:
      the InetAddress value associated with the specified id.
      See Also:
    • getInetAddress

      public InetAddress getInetAddress(String id, InetAddress defaultValue)
      Returns the first InetAddress value associated with the specified id. If the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.net.InetAddress, the specified default value is returned.
      Parameters:
      id - the id of the InetAddress value to retrieve
      defaultValue - the value to return if the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.net.InetAddress.
      Returns:
      the first InetAddress value associated with the specified id. If the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.lang.InetAddress, the specified default value is returned.
      See Also:
    • getInetAddressArray

      public InetAddress[] getInetAddressArray(String id)
      Returns an array of InetAddress values associated with the specified id. If the specified id does not exist within this JSAPResult, this method returns an empty array (i.e., array.length==0).
      Parameters:
      id - the id of the InetAddress value(s) to return.
      Returns:
      an array containing the InetAddress value(s) associated with the specified id, or an empty array if the specified id does not exist within this JSAPResult.
      See Also:
    • getPackage

      public Package getPackage(String id)
      Returns the first Package value associated with the specified id.
      Parameters:
      id - the id of the Package value to retrieve
      Returns:
      the Package value associated with the specified id.
      See Also:
    • getPackage

      public Package getPackage(String id, Package defaultValue)
      Returns the first Package value associated with the specified id. If the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.lang.Package, the specified default value is returned.
      Parameters:
      id - the id of the Package value to retrieve
      defaultValue - the value to return if the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.lang.Package.
      Returns:
      the first Package value associated with the specified id. If the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.lang.Package, the specified default value is returned.
      See Also:
    • getPackageArray

      public Package[] getPackageArray(String id)
      Returns an array of Package values associated with the specified id. If the specified id does not exist within this JSAPResult, this method returns an empty array (i.e., array.length==0).
      Parameters:
      id - the id of the Package value(s) to return.
      Returns:
      an array containing the Package value(s) associated with the specified id, or an empty array if the specified id does not exist within this JSAPResult.
      See Also:
    • getURL

      public URL getURL(String id)
      Returns the first URL value associated with the specified id.
      Parameters:
      id - the id of the URL value to retrieve
      Returns:
      the URL value associated with the specified id.
      See Also:
    • getURL

      public URL getURL(String id, URL defaultValue)
      Returns the first URL value associated with the specified id. If the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.net.URL, the specified default value is returned.
      Parameters:
      id - the id of the URL value to retrieve
      defaultValue - the value to return if the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.net.URL.
      Returns:
      the first URL value associated with the specified id. If the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.net.URL, the specified default value is returned.
      See Also:
    • getURLArray

      public URL[] getURLArray(String id)
      Returns an array of URL values associated with the specified id. If the specified id does not exist within this JSAPResult, this method returns an empty array (i.e., array.length==0).
      Parameters:
      id - the id of the URL value(s) to return.
      Returns:
      an array containing the URL value(s) associated with the specified id, or an empty array if the specified id does not exist within this JSAPResult.
      See Also:
    • getColor

      public Color getColor(String id)
      Returns the first Color value associated with the specified id.
      Parameters:
      id - the id of the Color value to retrieve
      Returns:
      the Color value associated with the specified id.
      See Also:
    • getFile

      public File getFile(String id)
      Returns the first File value associated with the specified id.
      Parameters:
      id - the id of the File value to retrieve
      Returns:
      the File value associated with the specified id.
      See Also:
    • getColor

      public Color getColor(String id, Color defaultValue)
      Returns the first Color value associated with the specified id. If the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.awt.Color, the specified default value is returned.
      Parameters:
      id - the id of the Color value to retrieve
      defaultValue - the value to return if the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.lang.Color.
      Returns:
      the first Color value associated with the specified id. If the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.awt.Color, the specified default value is returned.
      See Also:
    • getFile

      public File getFile(String id, File defaultValue)
      Returns the first File value associated with the specified id. If the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.io.File, the specified default value is returned.
      Parameters:
      id - the id of the File value to retrieve
      defaultValue - the value to return if the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.io.File.
      Returns:
      the first File value associated with the specified id. If the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.io.File, the specified default value is returned.
      See Also:
    • getColorArray

      public Color[] getColorArray(String id)
      Returns an array of Color values associated with the specified id. If the specified id does not exist within this JSAPResult, this method returns an empty array (i.e., array.length==0).
      Parameters:
      id - the id of the Color value(s) to return.
      Returns:
      an array containing the Color value(s) associated with the specified id, or an empty array if the specified id does not exist within this JSAPResult.
      See Also:
    • getFileArray

      public File[] getFileArray(String id)
      Returns an array of File values associated with the specified id. If the specified id does not exist within this JSAPResult, this method returns an empty array (i.e., array.length==0).
      Parameters:
      id - the id of the File value(s) to return.
      Returns:
      an array containing the File value(s) associated with the specified id, or an empty array if the specified id does not exist within this JSAPResult.
      See Also:
    • getDate

      public Date getDate(String id)
      Returns the first Date value associated with the specified id.
      Parameters:
      id - the id of the Date value to retrieve
      Returns:
      the Date value associated with the specified id.
      See Also:
    • getDate

      public Date getDate(String id, Date defaultValue)
      Returns the first Date value associated with the specified id. If the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.util.Date, the specified default value is returned.
      Parameters:
      id - the id of the Date value to retrieve
      defaultValue - the value to return if the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.util.Date.
      Returns:
      the first Date value associated with the specified id. If the specified id does not exist within this JSAPResult, or if the object(s) associated with the specified id are not of type java.util.Date, the specified default value is returned.
      See Also:
    • getDateArray

      public Date[] getDateArray(String id)
      Returns an array of Date values associated with the specified id. If the specified id does not exist within this JSAPResult, this method returns an empty array (i.e., array.length==0).
      Parameters:
      id - the id of the Date value(s) to return.
      Returns:
      an array containing the Date value(s) associated with the specified id, or an empty array if the specified id does not exist within this JSAPResult.
      See Also:
    • getException

      public Exception getException(String id)
      Returns the first exception associated with the specified parameter ID. "General" exceptions can be retrieved with a null id. If no exceptions are associated with the specified parameter ID, null is returned.
      Specified by:
      getException in interface ExceptionMap
      Parameters:
      id - the unique ID of the parameter for which the first exception is requested
      Returns:
      the first exception associated with the specified ID, or null if no exceptions are associated with the specified ID.
      See Also:
    • getExceptionArray

      public Exception[] getExceptionArray(String id)
      Returns an array of ALL exceptions associated with the specified parameter ID. If no exceptions are associated with the specified parameter ID, an empty (zero-length) array is returned.
      Specified by:
      getExceptionArray in interface ExceptionMap
      Parameters:
      id - the unique ID of the parameter for which the exceptions are requested.
      Returns:
      an array of ALL exceptions associated with the specified parameter ID, or an empty (zero-length) array if no exceptions are associated with the specified parameter ID.
      See Also:
    • getExceptionIterator

      public Iterator getExceptionIterator(String id)
      Returns an Iterator ovar ALL exceptions associated with the specified parameter ID. If no exceptions are associated with the specified parameter ID, an empty iterator (NOT null) is returned.
      Parameters:
      id - the unique ID of the parameter for which the exceptions are requested.
      Returns:
      an Iterator over ALL exceptions associated with the specified parameter ID
    • getErrorMessageIterator

      public Iterator getErrorMessageIterator()
      Returns an iterator over all error messages generated during parsing. If no errors occured, the iterator will be empty.
      Returns:
      an iterator over all error messages generated during parsing.
    • getBadParameterIDIterator

      public Iterator getBadParameterIDIterator()
      Returns an Iterator over the IDs of all parameters with associated exceptions (which can in turn be obtained via getExceptionIterator(String)). General exceptions not associated with any particular parameter are associated with the null ID, so null may be returned by this Iterator.
      Returns:
      an Iterator over the IDs of all parameters with associated exceptions.
    • success

      public boolean success()
      Returns a boolean indicating whether the parse that produced this JSAPResult was successful. If this method returns false, detailed information regarding the reasons for the failed parse can be obtained via the getException() methods.
      Returns:
      a boolean indicating whether the parse that produced this JSAPResult was successful.