The AnnotationStrategy object is used to intercept the serialization process and delegate to custom converters. This strategy uses the Convert annotation to specify the converter to use for serialization and deserialization. If there is no annotation present on the field or method representing the object instance to be serialized then this acts as a transparent proxy to an internal strategy.

By default the TreeStrategy is used to perform the normal serialization process should there be no annotation specifying a converter to use. However, any implementation can be used, including the CycleStrategy, which handles cycles in the object graph. To specify the internal strategy to use it can be provided in the constructor.

Inheritance: Strategy
    //public Item GetExtendedItem() {
    //   return extendedItem;
    //}
 public void TestCombinedStrategy() {
    Registry registry = new Registry();
    AnnotationStrategy annotationStrategy = new AnnotationStrategy();
    RegistryStrategy registryStrategy = new RegistryStrategy(registry, annotationStrategy);
    Persister persister = new Persister(registryStrategy);
    CombinationExample example = new CombinationExample(1, 2, 3);
    StringWriter writer = new StringWriter();
    registry.bind(Item.class, RegistryItemConverter.class);
    //public List<Entry> GetEntries() {
    //   return list;
    //}
 public void TestCycle() {
    CycleStrategy inner = new CycleStrategy();
    AnnotationStrategy strategy = new AnnotationStrategy(inner);
    Persister persister = new Persister(strategy);
    EntryListExample list = new EntryListExample();
    StringWriter writer = new StringWriter();
    Entry a = new Entry("A", "a");
    Entry b = new Entry("B", "b");
    Entry c = new Entry("C", "c");
    Entry primary = new Entry("PRIMARY", "primary");
    list.Primary = primary;
    list.AddEntry(a);
    list.AddEntry(b);
    list.AddEntry(c);
    list.AddEntry(b);
    list.AddEntry(c);
    persister.write(list, writer);
    persister.write(list, System.out);
    String text = writer.toString();
    EntryListExample copy = persister.read(EntryListExample.class, text);