Class JSONUtil
java.lang.Object
org.apache.felix.configurator.impl.json.JSONUtil
public class JSONUtil
extends java.lang.Object
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJSONUtil.Report -
Constructor Summary
Constructors Constructor Description JSONUtil() -
Method Summary
Modifier and Type Method Description static java.util.List<Config>createModel(BinaryManager binaryManager, long bundleId, org.apache.felix.cm.json.ConfigurationResource rsrc, java.util.Map<java.lang.String,java.lang.Integer> rankingMap, java.util.Map<java.lang.String,ConfigPolicy> policyMap)Create the modelstatic java.lang.StringgetResource(java.lang.String name, java.net.URL url)Read the contents of a resource, encoded as UTF-8static BundleStatereadConfigurationsFromBundle(BinUtil.ResourceProvider provider, java.util.Set<java.lang.String> paths, JSONUtil.Report report)Read all configurations from a bundlestatic ConfigurationFilereadJSON(BinaryManager binaryManager, java.lang.String name, java.net.URL url, long bundleId, java.lang.String contents, JSONUtil.Report report)Read a single JSON file
-
Constructor Details
-
JSONUtil
public JSONUtil()
-
-
Method Details
-
readConfigurationsFromBundle
public static BundleState readConfigurationsFromBundle(BinUtil.ResourceProvider provider, java.util.Set<java.lang.String> paths, JSONUtil.Report report)Read all configurations from a bundle- Parameters:
provider- The bundle providerpaths- The paths to read fromreport- The report for errors and warnings- Returns:
- The bundle state.
-
readJSON
public static ConfigurationFile readJSON(BinaryManager binaryManager, java.lang.String name, java.net.URL url, long bundleId, java.lang.String contents, JSONUtil.Report report)Read a single JSON file- Parameters:
binaryManager- The binary managername- The name of the fileurl- The url to that file ornullbundleId- The bundle id of the bundle containing the filecontents- The contents of the filereport- The report for errors and warnings- Returns:
- The configuration file or
null.
-
createModel
public static java.util.List<Config> createModel(BinaryManager binaryManager, long bundleId, org.apache.felix.cm.json.ConfigurationResource rsrc, java.util.Map<java.lang.String,java.lang.Integer> rankingMap, java.util.Map<java.lang.String,ConfigPolicy> policyMap)Create the model- Parameters:
binaryManager- The binary managerbundleId- The bundle idrsrc- The map containing the configurationsrankingMap- The map with ranking informationpolicyMap- The map with policy information- Returns:
- The list of
Configs
-
getResource
public static java.lang.String getResource(java.lang.String name, java.net.URL url) throws java.io.IOExceptionRead the contents of a resource, encoded as UTF-8- Parameters:
name- The resource nameurl- The resource URL- Returns:
- The contents
- Throws:
java.io.IOException- If anything goes wrong
-