< prev index next >

src/java.xml.bind/share/classes/com/sun/xml/internal/bind/CycleRecoverable.java

Print this page




  38  * This is not always a desired behavior.
  39  *
  40  * <p>
  41  * Implementing this interface allows user application to change this behavior.
  42  * Also see <a href="http://forums.java.net/jive/thread.jspa?threadID=13670">this related discussion</a>.
  43  *
  44  * @since JAXB 2.1 EA2
  45  * @author Kohsuke Kawaguchi
  46  */
  47 public interface CycleRecoverable {
  48     /**
  49      * Called when a cycle is detected by the JAXB RI marshaller
  50      * to nominate a new object to be marshalled instead.
  51      *
  52      * @param context
  53      *      This object is provided by the JAXB RI to inform
  54      *      the object about the marshalling process that's going on.
  55      *
  56      *
  57      * @return
  58      *      the object to be marshalled instead of <tt>this</tt> object.
  59      *      Or return null to indicate that the JAXB RI should behave
  60      *      just like when your object does not implement {@link CycleRecoverable}
  61      *      (IOW, cut the cycle arbitrarily and try to go on.)
  62      */
  63     Object onCycleDetected(Context context);
  64 
  65     /**
  66      * This interface is implemented by the JAXB RI to provide
  67      * information about the on-going marshalling process.
  68      *
  69      * <p>
  70      * We may add more methods in the future, so please do not
  71      * implement this interface in your application.
  72      */
  73     public interface Context {
  74         /**
  75          * Returns the marshaller object that's doing the marshalling.
  76          *
  77          * @return
  78          *      always non-null.


  38  * This is not always a desired behavior.
  39  *
  40  * <p>
  41  * Implementing this interface allows user application to change this behavior.
  42  * Also see <a href="http://forums.java.net/jive/thread.jspa?threadID=13670">this related discussion</a>.
  43  *
  44  * @since JAXB 2.1 EA2
  45  * @author Kohsuke Kawaguchi
  46  */
  47 public interface CycleRecoverable {
  48     /**
  49      * Called when a cycle is detected by the JAXB RI marshaller
  50      * to nominate a new object to be marshalled instead.
  51      *
  52      * @param context
  53      *      This object is provided by the JAXB RI to inform
  54      *      the object about the marshalling process that's going on.
  55      *
  56      *
  57      * @return
  58      *      the object to be marshalled instead of {@code this} object.
  59      *      Or return null to indicate that the JAXB RI should behave
  60      *      just like when your object does not implement {@link CycleRecoverable}
  61      *      (IOW, cut the cycle arbitrarily and try to go on.)
  62      */
  63     Object onCycleDetected(Context context);
  64 
  65     /**
  66      * This interface is implemented by the JAXB RI to provide
  67      * information about the on-going marshalling process.
  68      *
  69      * <p>
  70      * We may add more methods in the future, so please do not
  71      * implement this interface in your application.
  72      */
  73     public interface Context {
  74         /**
  75          * Returns the marshaller object that's doing the marshalling.
  76          *
  77          * @return
  78          *      always non-null.
< prev index next >