OSFI-Java  3.9.3
OpenSF Integration Library
esa.opensf.osfi.LoadResult< R > Class Template Reference

Classes

class  Builder
 
class  Event
 

Public Member Functions

boolean hasEvents (int minSeverity)
 
unwrap (final int minThrowSeverity) throws XmlParseException
 
unwrap () throws XmlParseException
 

Public Attributes

final String source
 
final R result
 
final List< Event > loadEvents
 

Static Public Attributes

static final int SEV_INFO = 10
 
static final int SEV_WARNING = 20
 
static final int SEV_ERROR = 30
 
static final int SEV_FATAL = 40
 

Detailed Description

Immutable type that represents the result of a "load" operation, either from ParamReader loading some configuration file, or raw parsing/validation of an XML file. It encapsulates the actual result together with a list of events of varying severities, e.g. warnings and errors collected during validation.

Parameters
<R>Type of the result object

Member Function Documentation

◆ hasEvents()

boolean esa.opensf.osfi.LoadResult< R >.hasEvents ( int  minSeverity)
Returns
true if any events with at least the given severity have been recorded.
Parameters
minSeveritycutoff value, events below this level are not considered.

◆ unwrap() [1/2]

Equivalent to calling unwrap(int) with SEV_ERROR.

Returns
The result field of this instance
Exceptions
XmlParseExceptionif any event with severity equal or higher than the argument exists

◆ unwrap() [2/2]

R esa.opensf.osfi.LoadResult< R >.unwrap ( final int  minThrowSeverity) throws XmlParseException

If no events at or above the given severity level exist, return result. Otherwise, throw a XmlParseException with the first such event as its cause.

Parameters
minThrowSeverityEvents below this level will be ignored in the check.
Returns
The result field of this instance
Exceptions
XmlParseExceptionif any event with severity equal or higher than the argument exists

References esa.opensf.osfi.LoadResult< R >.result.

Member Data Documentation

◆ loadEvents

final List<Event> esa.opensf.osfi.LoadResult< R >.loadEvents

Events recorded during the process. May be empty but never null.

◆ result

final R esa.opensf.osfi.LoadResult< R >.result

Result of the load operation. May be null if errors stopped the process.

◆ SEV_ERROR

final int esa.opensf.osfi.LoadResult< R >.SEV_ERROR = 30
static

Partially recoverable problems with the data source that imply a certain loss of data but which do not prevent further processing. For example, a <parameter> element of MATRIX type that contains an invalid number of columns in a row. The parameter itself cannot be parsed and is lost, but the rest of the file can be parsed.

◆ SEV_FATAL

final int esa.opensf.osfi.LoadResult< R >.SEV_FATAL = 40
static

Unrecoverable problems with the data source that stop all processing. For example, malformed XML in a configuration file will often prevent further parsing, and no results can be extracted.

◆ SEV_INFO

final int esa.opensf.osfi.LoadResult< R >.SEV_INFO = 10
static

General reports that do not represent any problem with the data source.

◆ SEV_WARNING

final int esa.opensf.osfi.LoadResult< R >.SEV_WARNING = 20
static

Recoverable issues with the data source e.g. a <parameter> element that still stores its data in the deprecated

value

attribute.

◆ source

final String esa.opensf.osfi.LoadResult< R >.source

Data source for the operation, e.g. a file. Never null.


The documentation for this class was generated from the following file: