public class SBMLErrorLog
extends java.lang.Object
This class is used both to have the same API as the libSBML equivalent, and also to store the information sent by the SBML online validator.
See:
Constructor | Description |
---|---|
SBMLErrorLog() |
Modifier and Type | Method | Description |
---|---|---|
boolean |
add(SBMLError e) |
Adds an error.
|
boolean |
add(Option option) |
Adds an option.
|
void |
clearLog() |
Clears the log.
|
SBMLError |
getError(long n) |
Returns the nth
SBMLError object in this log. |
int |
getErrorCount() |
Returns the number of errors that have been logged.
|
java.util.List<SBMLError> |
getErrorsBySeverity(SBMLError.SEVERITY severity) |
|
int |
getNumErrors() |
Returns the number of errors that have been logged.
|
int |
getNumFailsWithSeverity(SBMLError.SEVERITY severity) |
Returns the number of errors that have been logged with the given
severity code.
|
java.util.List<SBMLError> |
getValidationErrors() |
Returns the list of
SBMLError |
void |
setFile(java.io.File file) |
Sets the file.
|
void |
setOptions(java.util.List<Option> options) |
Sets the list of options.
|
void |
setStatus(java.lang.String status) |
Sets the status.
|
public boolean add(Option option)
option
- true
if the option was added successfully.public boolean add(SBMLError e)
e
- true
if the error was added successfully.public void clearLog()
public SBMLError getError(long n)
SBMLError
object in this log.
Index n
is counted from 0. Callers should first inquire about the
number of items in the log by using the
getNumErrors()
method.
Attempts to use an error index number that exceeds the actual number
of errors in the log will result in a null
being returned.
n
- the index number of the error to retrieve (with 0 being the
first error).
SBMLError
in this log, or null
if n
is
greater than or equal to getNumErrors()
.
getNumErrors()
public int getNumErrors()
To retrieve individual errors from the log, callers may use
getError(long n)
.
getErrorCount()
public int getErrorCount()
To retrieve individual errors from the log, callers may use
getError(long n)
.
public int getNumFailsWithSeverity(SBMLError.SEVERITY severity)
LibSBML associates severity levels with every SBMLError
object to
provide an indication of how serious the problem is. Severities range
from informational diagnostics to fatal (irrecoverable) errors. Given
an SBMLError
object instance, a caller can interrogate it for its
severity level using methods such as SBMLError.getSeverity()
,
SBMLError.isFatal()
, and so on. The present method encapsulates
iteration and interrogation of all objects in an SBMLErrorLog
, making
it easy to check for the presence of error objects with specific
severity levels.
severity
- a value from the enumeration SBMLError.SEVERITY
getNumErrors()
public java.util.List<SBMLError> getErrorsBySeverity(SBMLError.SEVERITY severity)
severity
- public java.util.List<SBMLError> getValidationErrors()
SBMLError
SBMLError
public void setFile(java.io.File file)
file
- public void setOptions(java.util.List<Option> options)
options
- public void setStatus(java.lang.String status)
status
-