001/** 002 * Copyright (C) 2007 - 2016, Jens Lehmann 003 * 004 * This file is part of DL-Learner. 005 * 006 * DL-Learner is free software; you can redistribute it and/or modify 007 * it under the terms of the GNU General Public License as published by 008 * the Free Software Foundation; either version 3 of the License, or 009 * (at your option) any later version. 010 * 011 * DL-Learner is distributed in the hope that it will be useful, 012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 014 * GNU General Public License for more details. 015 * 016 * You should have received a copy of the GNU General Public License 017 * along with this program. If not, see <http://www.gnu.org/licenses/>. 018 */ 019package org.dllearner.core.config; 020 021import java.lang.annotation.ElementType; 022import java.lang.annotation.Retention; 023import java.lang.annotation.RetentionPolicy; 024import java.lang.annotation.Target; 025 026/** 027 * 028 * Annotation for all DL-Learner configuration options. 029 * 030 * @author Chris Shellenbarger 031 * @author Jens Lehmann 032 * @author Lorenz Bühmann 033 */ 034@Retention(RetentionPolicy.RUNTIME) 035@Target(ElementType.FIELD) 036public @interface ConfigOption { 037 /** 038 * The description of this config option 039 * @return The description of this config option 040 */ 041 String description() default "no description available"; 042 043 /** 044 * Returns whether this option is required for initializing the component. 045 * 046 * Maybe soon deprecated: Please put @Required in the corresponding set method in addition. 047 * @return True if the option is required and false otherwise. 048 */ 049 boolean required() default false; 050 051 /** 052 * Returns the default value of this config option. Default values should be set for all 053 * optional values. 054 * It is an overhead to describe the default value both in the source code and in the 055 * annotation. There are two reasons for this: a) the value of the field cannot easily be accessed 056 * without creating an instance of the component and b) for more complex structures the default 057 * may only be created in the constructor or init method. 058 * @return The default value of this option. 059 */ 060 String defaultValue() default ""; 061 062 /** 063 * An example value for this option that can be displayed in the configuration options documentation. 064 * @return A valid example value for this option. 065 */ 066 String exampleValue() default ""; 067}