public class JSONUtil extends Object
Modifier and Type | Class and Description |
---|---|
static class |
JSONUtil.Report |
Constructor and Description |
---|
JSONUtil() |
Modifier and Type | Method and Description |
---|---|
static List<Config> |
createModel(BinaryManager binaryManager,
long bundleId,
org.apache.felix.cm.json.ConfigurationResource rsrc,
Map<String,Integer> rankingMap,
Map<String,ConfigPolicy> policyMap)
Create the model
|
static String |
getResource(String name,
URL url)
Read the contents of a resource, encoded as UTF-8
|
static BundleState |
readConfigurationsFromBundle(BinUtil.ResourceProvider provider,
Set<String> paths,
JSONUtil.Report report)
Read all configurations from a bundle
|
static ConfigurationFile |
readJSON(BinaryManager binaryManager,
String name,
URL url,
long bundleId,
String contents,
JSONUtil.Report report)
Read a single JSON file
|
public static BundleState readConfigurationsFromBundle(BinUtil.ResourceProvider provider, Set<String> paths, JSONUtil.Report report)
provider
- The bundle providerpaths
- The paths to read fromreport
- The report for errors and warningspublic static ConfigurationFile readJSON(BinaryManager binaryManager, String name, URL url, long bundleId, String contents, JSONUtil.Report report)
binaryManager
- The binary managername
- The name of the fileurl
- The url to that file or null
bundleId
- The bundle id of the bundle containing the filecontents
- The contents of the filereport
- The report for errors and warningsnull
.public static List<Config> createModel(BinaryManager binaryManager, long bundleId, org.apache.felix.cm.json.ConfigurationResource rsrc, Map<String,Integer> rankingMap, Map<String,ConfigPolicy> policyMap)
binaryManager
- The binary managerbundleId
- The bundle idrsrc
- The map containing the configurationsrankingMap
- The map with ranking informationpolicyMap
- The map with policy informationConfig
spublic static String getResource(String name, URL url) throws IOException
name
- The resource nameurl
- The resource URLIOException
- If anything goes wrongCopyright © 2006–2020 The Apache Software Foundation. All rights reserved.