1 package com.beust.jcommander; 2 3 import static java.lang.annotation.ElementType.FIELD; 4 5 import com.beust.jcommander.validators.NoValidator; 6 import com.beust.jcommander.validators.NoValueValidator; 7 8 import java.lang.annotation.Retention; 9 import java.lang.annotation.Target; 10 11 @Retention(java.lang.annotation.RetentionPolicy.RUNTIME) 12 @Target({ FIELD }) 13 public @interface DynamicParameter { 14 /** 15 * An array of allowed command line parameters (e.g. "-D", "--define", etc...). 16 */ names()17 String[] names() default {}; 18 19 /** 20 * Whether this option is required. 21 */ required()22 boolean required() default false; 23 24 /** 25 * A description of this option. 26 */ description()27 String description() default ""; 28 29 /** 30 * The key used to find the string in the message bundle. 31 */ descriptionKey()32 String descriptionKey() default ""; 33 34 /** 35 * If true, this parameter won't appear in the usage(). 36 */ hidden()37 boolean hidden() default false; 38 39 /** 40 * The validation class to use. 41 */ validateWith()42 Class<? extends IParameterValidator> validateWith() default NoValidator.class; 43 44 /** 45 * The character(s) used to assign the values. 46 */ assignment()47 String assignment() default "="; 48 validateValueWith()49 Class<? extends IValueValidator> validateValueWith() default NoValueValidator.class; 50 } 51