CycleStrategy
represents a strategy that is used to augment the deserialization and serialization process such that cycles in an object graph can be supported. This adds additional attributes to the serialized XML elements so that during the deserialization process an objects cycles can be created. Without the use of a strategy such as this, cycles could cause an infinite loop during the serialization process while traversing the graph. <root id="1"> <object id="2"> <object id="3" name="name">Example</item> <object reference="2"/> </object> </root> In the above serialized XML there is a circular reference, where the XML element with id "2" contains a reference to itself. In most data binding frameworks this will cause an infinite loop, or in some cases will just fail to represent the references well. With this strategy you can ensure that cycles in complex object graphs will be maintained and can be serialized safely.