|
@@ -2,10 +2,9 @@ |
2 |
2 |
|
|
3 |
3 |
|
import java.util.*; |
4 |
4 |
|
|
|
5 |
+ |
import org.litesoft.core.util.*; |
5 |
6 |
|
import org.litesoft.core.util.externalization.E13nData.*; |
6 |
7 |
|
|
7 |
|
- |
import com.temp.shared.utils.*; |
8 |
|
- |
|
9 |
8 |
|
/** |
10 |
9 |
|
* Since there can be many different implementations of E13nResolver, the |
11 |
10 |
|
* ability to chain them is not supported as all three "flavors" of the resolve |
|
@@ -46,7 +45,7 @@ |
46 |
45 |
|
*/ |
47 |
46 |
|
public static NonCompleting validateProxy( E13nResolver proxied ) |
48 |
47 |
|
{ |
49 |
|
- |
Assert.notNull( "Proxied E13nResolver", proxied ); |
|
48 |
+ |
UtilsCommon.assertNotNull( "Proxied E13nResolver", proxied ); |
50 |
49 |
|
if ( proxied instanceof NonCompleting ) |
51 |
50 |
|
{ |
52 |
51 |
|
return (NonCompleting) proxied; |
|
@@ -62,7 +61,7 @@ |
62 |
61 |
|
*/ |
63 |
62 |
|
public static String resolveDataWith( E13nData data, NonCompleting resolver ) |
64 |
63 |
|
{ |
65 |
|
- |
Assert.notNull( "E13nData data", data ); |
|
64 |
+ |
UtilsCommon.assertNotNull( "E13nData data", data ); |
66 |
65 |
|
String key = data.getTemplateIdCode(); |
67 |
66 |
|
return processResolvedWithSubKeys( key, resolver.resolveWithoutCompleting( key ), resolver, data.getTemplateSubstitutionNamedValues() ); |
68 |
67 |
|
} |
|
@@ -75,9 +74,9 @@ |
75 |
74 |
|
*/ |
76 |
75 |
|
public static String resolveEnumWith( Enum<?> key, NonCompleting resolver ) |
77 |
76 |
|
{ |
78 |
|
- |
Assert.notNull( "Enum key", key ); |
|
77 |
+ |
UtilsCommon.assertNotNull( "Enum key", key ); |
79 |
78 |
|
String keyName = key.name(); |
80 |
|
- |
String prefix = ObjectUtils.getSimpleClassName( key ); |
|
79 |
+ |
String prefix = UtilsCommon.justClassNameOf( key ); |
81 |
80 |
|
String value = resolver.resolveWithoutCompleting( prefix + E13nResolver.PREFIX_SEP + keyName ); |
82 |
81 |
|
if ( value == null ) |
83 |
82 |
|
{ |
|
@@ -94,7 +93,7 @@ |
94 |
93 |
|
*/ |
95 |
94 |
|
public static String resolveStringWith( String key, NonCompleting resolver ) |
96 |
95 |
|
{ |
97 |
|
- |
key = Assert.noEmpty( "String key", key ); |
|
96 |
+ |
key = UtilsCommon.assertNotNullNotEmpty( "String key", key ); |
98 |
97 |
|
return processResolvedWithSubKeys( key, resolver.resolveWithoutCompleting( key ), resolver, Collections.<String, SubstitutionValue>emptyMap() ); |
99 |
98 |
|
} |
100 |
99 |
|
|
|
@@ -193,7 +192,7 @@ |
193 |
192 |
|
* @param wrappedKey wrapped key to looked up (!null) (wrapped means still |
194 |
193 |
|
* surrounded by the sub-key indicators - see: E13nResolver INIT |
195 |
194 |
|
* & FINI) |
196 |
|
- |
* @param value value found without completing for the key (null OK) |
|
195 |
+ |
* @param resolver NonCompleting resolver to get the raw resolved value from |
197 |
196 |
|
* @param overrides key/value pairs to resolve sub-keys from first (before |
198 |
197 |
|
* delegating to the resolver) |
199 |
198 |
|
* |
|
@@ -227,7 +226,7 @@ |
227 |
226 |
|
* |
228 |
227 |
|
* @param depth used to track levels of recursion for giving up! |
229 |
228 |
|
* @param key key to looked up (!null but may be "") |
230 |
|
- |
* @param value value found without completing for the key (null OK) |
|
229 |
+ |
* @param resolver NonCompleting resolver to get the raw resolved value from |
231 |
230 |
|
* @param overrides key/value pairs to resolve sub-keys from first (before |
232 |
231 |
|
* delegating to the resolver) |
233 |
232 |
|
* |