001/* 002 * Resolve.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>Resolve</code> method is used to resolve an object that 026 * has been deserialized from the XML document. This is used when the 027 * deserialized object whats to provide a substitute to itself within 028 * the object graph. This is particularly useful when an object is 029 * used to reference an external XML document, as it allows that XML 030 * document to be deserialized in to a new object instance. 031 * <p> 032 * This is similar to the <code>readResolve</code> method used within 033 * Java Object Serialization in that it is used to create a object to 034 * plug in to the object graph after it has been fully deserialized. 035 * Care should be taken when using this annotation as the object that 036 * is returned from the resolve method must match the field type such 037 * that the resolved object is an assignable substitute. 038 * 039 * @author Niall Gallagher 040 */ 041@Retention(RetentionPolicy.RUNTIME) 042public @interface Resolve { 043}