Package com.martiansoftware.jsap
Class JSAPResult
java.lang.Object
com.martiansoftware.jsap.JSAPResult
- All Implemented Interfaces:
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
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Adds the specified values to any existing values already associated with the specified id, if any.void
addException
(String id, Exception exception) Adds the specified exception to the exception map.boolean
Returns true if this JSAPResult contains any results for the specified id.Returns an Iterator over the IDs of all parameters with associated exceptions (which can in turn be obtained via getExceptionIterator(String)).getBigDecimal
(String id) Returns the first BigDecimal value associated with the specified id.getBigDecimal
(String id, BigDecimal defaultValue) Returns the first BigDecimal value associated with the specified id.Returns an array of BigDecimal values associated with the specified id.getBigInteger
(String id) Returns the first BigInteger value associated with the specified id.getBigInteger
(String id, BigInteger defaultValue) Returns the first BigInteger value associated with the specified id.Returns an array of BigInteger values associated with the specified id.boolean
getBoolean
(String id) Returns the first boolean value associated with the specified id.boolean
getBoolean
(String id, boolean defaultValue) Returns the first boolean value associated with the specified id.boolean[]
Returns an array of boolean values associated with the specified id.byte
Returns the first byte value associated with the specified id.byte
Returns the first byte value associated with the specified id.byte[]
getByteArray
(String id) Returns an array of byte values associated with the specified id.char
Returns the first char value associated with the specified id.char
Returns the first char value associated with the specified id.char[]
getCharArray
(String id) Returns an array of char values associated with the specified id.Returns the first Class value associated with the specified id.Returns the first Class value associated with the specified id.Class[]
getClassArray
(String id) Returns an array of Class values associated with the specified id.Returns the first Color value associated with the specified id.Returns the first Color value associated with the specified id.Color[]
getColorArray
(String id) Returns an array of Color values associated with the specified id.Returns the first Date value associated with the specified id.Returns the first Date value associated with the specified id.Date[]
getDateArray
(String id) Returns an array of Date values associated with the specified id.double
Returns the first double value associated with the specified id.double
Returns the first double value associated with the specified id.double[]
getDoubleArray
(String id) Returns an array of double values associated with the specified id.Returns an iterator over all error messages generated during parsing.getException
(String id) Returns the first exception associated with the specified parameter ID.Returns an array of ALL exceptions associated with the specified parameter ID.Returns an Iterator ovar ALL exceptions associated with the specified parameter ID.Returns the first File value associated with the specified id.Returns the first File value associated with the specified id.File[]
getFileArray
(String id) Returns an array of File values associated with the specified id.float
Returns the first float value associated with the specified id.float
Returns the first float value associated with the specified id.float[]
getFloatArray
(String id) Returns an array of float values associated with the specified id.getInetAddress
(String id) Returns the first InetAddress value associated with the specified id.getInetAddress
(String id, InetAddress defaultValue) Returns the first InetAddress value associated with the specified id.Returns an array of InetAddress values associated with the specified id.int
Returns the first integer value associated with the specified id.int
Returns the first integer value associated with the specified id.int[]
getIntArray
(String id) Returns an array of integer values associated with the specified id.long
Returns the first long value associated with the specified id.long
Returns the first long value associated with the specified id.long[]
getLongArray
(String id) Returns an array of long values associated with the specified id.Returns the first object associated with the specified ID.Object[]
getObjectArray
(String id) Returns all values associated with the specified ID.Object[]
getObjectArray
(String id, Object[] a) Returns an array containing all of the values associated with the specified ID.getPackage
(String id) Returns the first Package value associated with the specified id.getPackage
(String id, Package defaultValue) Returns the first Package value associated with the specified id.Package[]
Returns an array of Package values associated with the specified id.Returns the string value associated with the specified ID for QualifiedSwitches.short
Returns the first short value associated with the specified id.short
Returns the first short value associated with the specified id.short[]
getShortArray
(String id) Returns an array of short values associated with the specified id.Returns the first String value associated with the specified id.Returns the first String value associated with the specified id.String[]
getStringArray
(String id) Returns an array of String values associated with the specified id.Returns the first URL value associated with the specified id.Returns the first URL value associated with the specified id.URL[]
getURLArray
(String id) Returns an array of URL values associated with the specified id.boolean
success()
Returns a boolean indicating whether the parse that produced this JSAPResult was successful.boolean
userSpecified
(String id) Returns true if this JSAPResult contains any user-specified values for the specified id.
-
Constructor Details
-
JSAPResult
protected JSAPResult()Creates new JSAPResult
-
-
Method Details
-
contains
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
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.
-
add
Adds the specified values to any existing values already associated with the specified id, if any.- Parameters:
id
- the unique ID of the parameter with which the specified values are associated.values
- a List containing the additional values to associate with the specified ID.
-
addException
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 interfaceExceptionMap
- 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
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
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
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 requesteda
- 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
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
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 retrievedefaultValue
- 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
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
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
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 retrievedefaultValue
- 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
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
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
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
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 retrievedefaultValue
- 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
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
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
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 retrievedefaultValue
- 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
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
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
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 retrievedefaultValue
- 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
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
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
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 retrievedefaultValue
- 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
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
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
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 retrievedefaultValue
- 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
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
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
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 retrievedefaultValue
- 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
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
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
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 retrievedefaultValue
- 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
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
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
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 retrievedefaultValue
- 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
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
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
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 retrievedefaultValue
- 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
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
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
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 retrievedefaultValue
- 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
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
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
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 retrievedefaultValue
- 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
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
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
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 retrievedefaultValue
- 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
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
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
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 retrievedefaultValue
- 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
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
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
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
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 retrievedefaultValue
- 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
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 retrievedefaultValue
- 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
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
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
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
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 retrievedefaultValue
- 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
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
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 interfaceExceptionMap
- 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
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 interfaceExceptionMap
- 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
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
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
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.
-