diff options
author | hyeongseok.heo <hyeongseok.heo@samsung.com> | 2013-10-02 10:07:27 +0900 |
---|---|---|
committer | hyeongseok.heo <hyeongseok.heo@samsung.com> | 2013-10-02 10:07:27 +0900 |
commit | 7db2a46b2612ff13a9b773e6122b9adeba118762 (patch) | |
tree | 2a9018060dc0fbfac163af8cdacd82812bb27876 | |
parent | cd10760419037e99ba4664bb0e8e1fb276f77b04 (diff) | |
download | common-eplugin-ncli.tar.gz common-eplugin-ncli.tar.bz2 common-eplugin-ncli.zip |
[Title] add get(String namespace,String key) methodncli
[Desc.]
[Issue]
Change-Id: I4776b73bb6a63412d6f672c5b035c25005d36576
Signed-off-by: hyeongseok.heo <hyeongseok.heo@samsung.com>
-rwxr-xr-x | org.tizen.common/src/org/tizen/common/config/Preference.java | 22 |
1 files changed, 21 insertions, 1 deletions
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 }
+
+
}
|