As discussed in the users' guide, normally a cycle in the object graph causes the marshaller to report an error, and when an error is found, the JAXB RI recovers by cutting the cycle arbitrarily. This is not always a desired behavior.
Implementing this interface allows user application to change this behavior.
| Modifier and Type | Class and Description |
|---|---|
| public static interface | CycleRecoverable.
This interface is implemented by the JAXB RI to provide information about the on-going marshalling process. |
| Modifier and Type | Method and Description |
|---|---|
| public Object | Returns: the object to be marshalled instead ofthis object.
Or return null to indicate that the JAXB RI should behave
just like when your object does not implement
(IOW, cut the cycle arbitrarily and try to go on.)This object is provided by the JAXB RI to inform
the object about the marshalling process that's going on. contextCalled when a cycle is detected by the JAXB RI marshaller to nominate a new object to be marshalled instead. |
| onCycleDetected | back to summary |
|---|---|
| public Object onCycleDetected(CycleRecoverable. Called when a cycle is detected by the JAXB RI marshaller to nominate a new object to be marshalled instead.
| |
We may add more methods in the future, so please do not implement this interface in your application.
| Modifier and Type | Method and Description |
|---|---|
| public Marshaller |
| getMarshaller | back to summary |
|---|---|
| public Marshaller getMarshaller() Returns the marshaller object that's doing the marshalling.
| |