org.sbml.jsbml
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:
Modifier and Type | Field and Description |
---|---|
private java.io.File |
file |
private java.util.List<Option> |
options |
private java.lang.String |
status |
private java.util.List<SBMLError> |
validationErrors |
Constructor and Description |
---|
SBMLErrorLog() |
Modifier and Type | Method and Description |
---|---|
(package private) boolean |
add(Option option)
Adds an option.
|
(package private) boolean |
add(SBMLError e)
Adds an error.
|
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.
|
(package private) java.io.File |
getFile()
Returns the file containing the xml error log representation.
|
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.
|
(package private) java.util.List<Option> |
getOptions()
Returns the list of options.
|
(package private) java.lang.String |
getStatus()
Returns the status of the error log.
|
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.
|
(package private) void |
setValidationErrors(java.util.List<SBMLError> validationErrors)
Sets the list of errors.
|
private java.io.File file
private java.util.List<Option> options
private java.util.List<SBMLError> validationErrors
private java.lang.String status
boolean add(Option option)
option
- true
if the option was added successfully.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()
java.io.File getFile()
public int getNumErrors()
To retrieve individual errors from the log, callers may use
getError(long n)
.
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()
java.util.List<Option> getOptions()
java.lang.String getStatus()
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
- void setValidationErrors(java.util.List<SBMLError> validationErrors)
validationErrors
-