litesoft
@ 950
litesoft / trunk / GWT_Sandbox / FormEngine / src / org / litesoft / core / util / externalization / E13nResolver.java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
package org.litesoft.core.util.externalization; /** * Externalization Resolver that takes an E13nData (or Enum key or String key) * and resolves it to a String with an Externally Sourced String keyed template * system that supports substitutions within any specific template by "named" * values. * <p/> * Since Substitution Keys may NOT have spaces, spaces can be used to force a * what would appear to be a substitution key (something between the INIT & FINI * characters) to be ignored. Unbalanced INIT & FINI characters or an * empty substitution key are also ignored. */ public interface E13nResolver { public static final char PREFIX_SEP = '_'; public static final char INIT = '{'; // For Substitution Key public static final char FINI = '}'; // For Substitution Key public static final String DONT_SHOW_SUBSTITUTION_ID = "{DontShow}"; // Replaced by a "" (empty String) public static final String SPACE_SUBSTITUTION_ID = "{Space}"; // used to force either leading or trailing spaces from being "trim()" away /** * Resolves the 'data' to a String by implementing an Externally Sourced * String keyed template system that supports substitutions within any * specific template by "named" values. * * @param data !null * * @return Resolved String form of the !null 'data'; */ public String resolve( E13nData data ); /** * Resolves the 'key' (by optionally prefixing its name with the enum's * simple class name) to a String by implementing an Externally Sourced * String keyed template system that supports substitutions within any * specific template by "named" values. * * @param key !null * * @return Resolved String form of the !null 'key'; */ public String resolve( Enum<?> key ); /** * Resolves the 'key' to a String by implementing an Externally Sourced * String keyed template system that supports substitutions within any * specific template by "named" values. * * @param key !null & !empty (after trimming) * * @return Resolved String form of the !empty 'key'; */ public String resolve( String key ); } |