001/*
002 * Configurate
003 * Copyright (C) zml and Configurate contributors
004 *
005 * Licensed under the Apache License, Version 2.0 (the "License");
006 * you may not use this file except in compliance with the License.
007 * You may obtain a copy of the License at
008 *
009 *    http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.spongepowered.configurate.objectmapping.meta;
018
019import java.lang.annotation.ElementType;
020import java.lang.annotation.Retention;
021import java.lang.annotation.RetentionPolicy;
022import java.lang.annotation.Target;
023import java.util.ResourceBundle;
024
025/**
026 * A comment that will be applied to a configuration node if possible.
027 *
028 * <p>By default, this node will not override any user-defined comments.</p>
029 *
030 * <p>When used with an object mapper with a {@link Processor#comments()} or
031 * {@link Processor#localizedComments(ResourceBundle)} processor applied,
032 * the comment in {@link #value()} will be applied to the node upon save.</p>
033 *
034 * @since 4.0.0
035 */
036@Target({ElementType.FIELD, ElementType.PARAMETER})
037@Retention(RetentionPolicy.RUNTIME)
038public @interface Comment {
039
040    /**
041     * The comment to use.
042     *
043     * @return comment
044     * @since 4.0.0
045     */
046    String value();
047
048    /**
049     * Whether or not to override existing comments on a node.
050     *
051     * @return if we should override.
052     * @since 4.0.0
053     */
054    boolean override() default false;
055
056}