001/*
002 * Copyright 2011 Atteo.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
005 * in compliance with the License. You may obtain a copy of the License at
006 *
007 * http://www.apache.org/licenses/LICENSE-2.0
008 *
009 * Unless required by applicable law or agreed to in writing, software distributed under the License
010 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
011 * or implied. See the License for the specific language governing permissions and limitations under
012 * the License.
013 */
014package org.atteo.evo.config;
015
016import java.lang.annotation.Documented;
017import java.lang.annotation.Retention;
018import java.lang.annotation.RetentionPolicy;
019
020import javax.xml.bind.annotation.XmlElement;
021
022/**
023 * Specifies the default value for the field when using {@link Configuration}.
024 *
025 * <p>
026 * This differs from {@link XmlElement#defaultValue()} in that it always assigns the default value
027 * when the class which contains annotated field is unmarshalled.
028 * See <a href="http://jaxb.java.net/guide/Element_default_values_and_unmarshalling.html">this link</a>
029 * for an explanation how ordinary {@link XmlElement} default value works.
030 * </p>
031 * <p>
032 * This annotation can also be used on properties which would not be touched by JAXB otherwise.
033 * </p>
034 */
035@Documented
036@Retention(RetentionPolicy.RUNTIME)
037public @interface XmlDefaultValue {
038    /**
039     * Default value to assign to the field.
040     */
041    String value();
042}