org.simpleframework.xml.core
Annotation Type Replace


@Retention(value=RUNTIME)
public @interface Replace

The Replace method is used to replace an object that is about to be serialized to an XML document. This is used to so that an object can provide a substitute to itself. Scenarios such as serializing an object to an external file or location can be accommodated using a write replacement method.

This is similar to the writeReplace method used within Java Object Serialization in that it is used to plug a replacement in to the resulting stream during the serialization process. Care should be taken to provide a suitable type from the replacement so that the object can be deserialized at a later time.

Author:
Niall Gallagher