001/* 002 * Replace.java June 2007 003 * 004 * Copyright (C) 2007, Niall Gallagher <niallg@users.sf.net> 005 * 006 * Licensed under the Apache License, Version 2.0 (the "License"); 007 * you may not use this file except in compliance with the License. 008 * You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, software 013 * distributed under the License is distributed on an "AS IS" BASIS, 014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 015 * implied. See the License for the specific language governing 016 * permissions and limitations under the License. 017 */ 018 019package org.simpleframework.xml.core; 020 021import java.lang.annotation.RetentionPolicy; 022import java.lang.annotation.Retention; 023 024/** 025 * The <code>Replace</code> method is used to replace an object that 026 * is about to be serialized to an XML document. This is used to so 027 * that an object can provide a substitute to itself. Scenarios such 028 * as serializing an object to an external file or location can be 029 * accommodated using a write replacement method. 030 * <p> 031 * This is similar to the <code>writeReplace</code> method used within 032 * Java Object Serialization in that it is used to plug a replacement 033 * in to the resulting stream during the serialization process. Care 034 * should be taken to provide a suitable type from the replacement so 035 * that the object can be deserialized at a later time. 036 * 037 * @author Niall Gallagher 038 */ 039@Retention(RetentionPolicy.RUNTIME) 040public @interface Replace { 041}