1 package net.sourceforge.argval; 2 3 import java.util.Map; 4 import java.util.Properties; 5 6 import net.sourceforge.argval.impl.PropertiesConfigurationManager; 7 8 public interface ConfigurationManager { 9 10 /** The base property key for all property keys related to this class. */ 11 public final static String PROP_ARG_VAL = "argument_validation"; 12 13 /** Under this property key name, all the pattern names should be added. By default a space 14 * is used to separate the pattern names. 15 * An example: 16 * <pre> 17 * argument_validation.patterns = number telephone_number 18 * </pre> 19 * @see PropertiesConfigurationManager#PROP_POSTFIX_REG_EXP */ 20 public final static String PROP_ARG_VAL_PATTERNS = "patters"; //PropertiesUtil.createKey(PROP_ARG_VAL, "patterns"); 21 22 public final static String PROP_ARG_VAL_PATTERN = "pattern"; //PropertiesUtil.createKey(PROP_ARG_VAL, "pattern"); 23 24 public final static String PROP_ARG_VAL_DATE_FORMAT = "date_format"; //PropertiesUtilImpl.createKey(PROP_ARG_VAL, "date_format"); 25 26 //public final static String PROP_POSTFIX_NAME = "name"; 27 /** This postfix key is used to get the regular expression of each pattern name. 28 * An example: 29 * <pre> 30 * argument_validation.number.regexp = ^[0-9]+$ 31 * argument_validation.telephone_number.regexp = .... 32 * </pre> 33 * @see PROP_ARG_VAL_PATTERNS */ 34 public final static String PROP_POSTFIX_REG_EXP = "regexp"; 35 36 public final static String PROP_POSTFIX_PATTERN = "pattern"; 37 38 /** 39 * 40 * @param patternMap 41 * @return 42 */ 43 Properties createPatternProperties(Map<String, String> patternMap); 44 45 Map<String, String> createPatternMapOldSchool(Properties properties); 46 47 /** 48 * argument_validation.pattern[number].regexp = ^[0-9]+$ 49 * argument_validation.pattern[telephone_number].regexp = .... 50 * 51 * @param properties 52 * @return 53 */ 54 Map<String, String> createPatternMap(Properties properties); 55 56 Map<String, String> createDateFormatMap(Properties properties); 57 58 }