From 7db2a46b2612ff13a9b773e6122b9adeba118762 Mon Sep 17 00:00:00 2001 From: "hyeongseok.heo" Date: Wed, 2 Oct 2013 10:07:27 +0900 Subject: [Title] add get(String namespace,String key) method [Desc.] [Issue] Change-Id: I4776b73bb6a63412d6f672c5b035c25005d36576 Signed-off-by: hyeongseok.heo --- .../src/org/tizen/common/config/Preference.java | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/org.tizen.common/src/org/tizen/common/config/Preference.java b/org.tizen.common/src/org/tizen/common/config/Preference.java index b1269bc05..c076fbb22 100755 --- a/org.tizen.common/src/org/tizen/common/config/Preference.java +++ b/org.tizen.common/src/org/tizen/common/config/Preference.java @@ -32,6 +32,7 @@ import java.util.HashSet; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.tizen.common.util.Assert; import org.tizen.common.util.ParsingUtil; /** @@ -128,7 +129,6 @@ Preference /** * Return preference expression * - * @param name namespace name * @param key preference key * * @return preference expression @@ -154,6 +154,24 @@ Preference return null; } + + /** + * Return preference value by namespace + * @param namespace + * @param key + * @return + */ + public static String get(String namespace, String key) { + Assert.notNull(namespace); + logger.info( "Namespace :{}, Key :{}", namespace,key ); + PreferenceProvider provider = name2provider.get(namespace); + if( null != provider) { + final String exp = provider.get( key ); + logger.debug( "Provider :{}, Value :{}", provider, exp ); + return exp; + } + return null; + } /* List */ /** @@ -255,4 +273,6 @@ Preference } + + } -- cgit v1.2.3