ValidationEventHandler
implementation that collects all events.
To use this class, create a new instance and pass it to the setEventHandler method of the Unmarshaller, Marshaller class. After the call to validate or unmarshal completes, call the getEvents method to retrieve all the reported errors and warnings.
jakarta.xml.bind.ValidationEventHandler, jakarta.xml.bind.ValidationEvent, jakarta.xml.bind.ValidationEventLocator
| Modifier and Type | Field and Description |
|---|---|
| private final List |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private static void | |
| public ValidationEvent[] | Returns: a copy of all the collected errors and warnings or an empty array if there weren't anyReturn an array of ValidationEvent objects containing a copy of each of the collected errors and warnings. |
| public boolean | handleEvent(ValidationEvent
the encapsulated validation event information. It is a
provider error if this parameter is null. event)Implements jakarta. |
| public boolean | Returns: true if this event collector contains at least one ValidationEvent, false otherwiseReturns true if this event collector contains at least one ValidationEvent. |
| public void |
| events | back to summary |
|---|---|
| private final List<ValidationEvent> events | |
| ValidationEventCollector | back to summary |
|---|---|
| public ValidationEventCollector() | |
| _assert | back to summary |
|---|---|
| private static void _assert(boolean b, String msg) | |
| getEvents | back to summary |
|---|---|
| public ValidationEvent[] getEvents() Return an array of ValidationEvent objects containing a copy of each of the collected errors and warnings.
| |
| handleEvent | back to summary |
|---|---|
| public boolean handleEvent(ValidationEvent event) Implements jakarta. Doc from jakarta. Receive notification of a validation warning or error.
The ValidationEvent will have a
If an unchecked runtime exception is thrown from this method, the Jakarta XML Binding provider will treat it as if the method returned false and interrupt the current unmarshal, validate, or marshal operation.
| |
| hasEvents | back to summary |
|---|---|
| public boolean hasEvents() Returns true if this event collector contains at least one ValidationEvent.
| |
| reset | back to summary |
|---|---|
| public void reset() Clear all collected errors and warnings. | |