R
- Type of the result objectpublic final class LoadResult<R>
extends java.lang.Object
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.Modifier and Type | Class and Description |
---|---|
static class |
LoadResult.Builder<E extends java.lang.Exception>
Helper that processes events during a load operation to generate a
LoadResult . |
static class |
LoadResult.Event
"Event" raised during a load operation (of parameters, of an XML file, etc).
|
Modifier and Type | Field and Description |
---|---|
java.util.List<LoadResult.Event> |
loadEvents
Events recorded during the process.
|
R |
result
Result of the load operation.
|
static int |
SEV_ERROR
Partially recoverable problems with the data source that imply a certain loss of
data but which do not prevent further processing.
|
static int |
SEV_FATAL
Unrecoverable problems with the data source that stop all processing.
|
static int |
SEV_INFO
General reports that do not represent any problem with the data source.
|
static int |
SEV_WARNING
Recoverable issues with the data source e.g.
|
java.lang.String |
source
Data source for the operation, e.g.
|
Modifier and Type | Method and Description |
---|---|
boolean |
hasEvents(int minSeverity) |
R |
unwrap()
Equivalent to calling
unwrap(int) with SEV_ERROR . |
R |
unwrap(int minThrowSeverity)
If no events at or above the given severity level exist, return
result . |
public static final int SEV_INFO
public static final int SEV_WARNING
value
attribute.public static final int SEV_ERROR
public static final int SEV_FATAL
public final java.lang.String source
public final R result
public final java.util.List<LoadResult.Event> loadEvents
public boolean hasEvents(int minSeverity)
minSeverity
- cutoff value, events below this level are not considered.public R unwrap(int minThrowSeverity) throws XmlParseException
result
.
Otherwise, throw a XmlParseException
with the first such event as its cause.minThrowSeverity
- Events below this level will be ignored in the check.result
field of this instanceXmlParseException
- if any event with severity equal or higher than the argument existspublic R unwrap() throws XmlParseException
unwrap(int)
with SEV_ERROR
.XmlParseException