001/* 002 * Validate.java July 2006 003 * 004 * Copyright (C) 2006, 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>Validate</code> annotation is used to mark a method in 026 * a serializable object that requires a callback from the persister 027 * once the deserialization completes. The validate method is invoked 028 * by the <code>Persister</code> after all fields have been assigned 029 * and before the commit method is invoked. 030 * <p> 031 * Typically the validate method is used to validate the fields that 032 * have been assigned once deserialization has been completed. The 033 * validate method must be a no argument public method or a method 034 * that takes a <code>Map</code> as the only argument. When invoked 035 * the object can determine whether the fields are valid, if the 036 * field values do not conform to the objects requirements then the 037 * method can throw an exception to terminate deserialization. 038 * 039 * @author Niall Gallagher 040 * 041 * @see org.simpleframework.xml.core.Commit 042 */ 043@Retention(RetentionPolicy.RUNTIME) 044public @interface Validate { 045}