/** * Perform substitution on a property set * * @param properties the property set to perform substitution on */ public static void performSubstitution(Map<String,String> properties) { performSubstitution(properties, (BundleContext) null); }
/** * Perform substitution on a property set * * @param properties the property set to perform substitution on * @param callback Callback for substituion */ public static void performSubstitution(Map<String,String> properties, SubstitutionCallback callback) { performSubstitution(properties, callback, true, true, true); }
/** * Perform substitution on a property set * * @param properties the property set to perform substitution on */ public static void performSubstitution(Map<String,String> properties) { performSubstitution(properties, (BundleContext) null); }
/** * Perform substitution on a property set * * @param properties the property set to perform substitution on */ public static void performSubstitution(Map<String,String> properties) { performSubstitution(properties, (BundleContext) null); }
/** * Perform substitution on a property set * * @param properties the property set to perform substitution on * @param callback Callback for substituion */ public static void performSubstitution(Map<String,String> properties, SubstitutionCallback callback) { performSubstitution(properties, callback, true, true, true); }
/** * Perform substitution on a property set * * @param properties the property set to perform substitution on */ public static void performSubstitution(Map<String,String> properties) { performSubstitution(properties, (BundleContext) null); }
/** * Perform substitution on a property set * * @param properties the property set to perform substitution on * @param callback Callback for substituion */ public static void performSubstitution(Map<String,String> properties, SubstitutionCallback callback) { performSubstitution(properties, callback, true, true, true); }
public void substitute(InterpolationHelper.SubstitutionCallback callback) { if(callback != null) { InterpolationHelper.performSubstitution(storage, callback); } else { InterpolationHelper.performSubstitution(storage); } }
private void performSubstitution(Hashtable<String, Object> current) { Map<String, String> simpleConfig = Maps.newHashMap(); for (Map.Entry<String, Object> e : current.entrySet()) { if (e.getValue() instanceof String) { simpleConfig.put(e.getKey(), (String) e.getValue()); } } InterpolationHelper.performSubstitution(simpleConfig, bundleContext); for (Map.Entry<String, String> e : simpleConfig.entrySet()) { current.put(e.getKey(), e.getValue()); } }
public void substitute(InterpolationHelper.SubstitutionCallback callback) { if (callback == null) { callback = new InterpolationHelper.BundleContextSubstitutionCallback(null); } InterpolationHelper.performSubstitution(storage, callback); }
public void substitute(InterpolationHelper.SubstitutionCallback callback) { if (callback == null) { callback = new InterpolationHelper.BundleContextSubstitutionCallback(null); } InterpolationHelper.performSubstitution(storage, callback); }
/** * Perform substitution on a property set * * @param properties the property set to perform substitution on * @param context The bundle context */ public static void performSubstitution(Map<String,String> properties, BundleContext context) { performSubstitution(properties, new BundleContextSubstitutionCallback(context)); }
public void substitute(InterpolationHelper.SubstitutionCallback callback) { if (callback == null) { callback = new InterpolationHelper.BundleContextSubstitutionCallback(null); } InterpolationHelper.performSubstitution(storage, callback); }
/** * Perform substitution on a property set * * @param properties the property set to perform substitution on * @param context The bundle context */ public static void performSubstitution(Map<String,String> properties, BundleContext context) { performSubstitution(properties, new BundleContextSubstitutionCallback(context)); }
/** * Perform substitution on a property set * * @param properties the property set to perform substitution on * @param context The bundle context */ public static void performSubstitution(Map<String,String> properties, BundleContext context) { performSubstitution(properties, new BundleContextSubstitutionCallback(context)); }
/** * Perform substitution on a property set * * @param properties the property set to perform substitution on */ public static void performSubstitution(Map<String,String> properties, BundleContext context) { performSubstitution(properties, new BundleContextSubstitutionCallback(context)); }
public static List<Configuration> createConfigurations(BundleContext context, Map<String, Map<String, String>> configs) { List<Configuration> configurations = new ArrayList<>(); for (Map.Entry<String, Map<String, String>> entry : configs.entrySet()) { String pid[] = parsePid(entry.getKey()); Map<String, String> cfg = entry.getValue(); InterpolationHelper.performSubstitution(cfg, context); cfg.put(Constants.SERVICE_PID, pid[0]); configurations.add(new StaticConfigurationImpl(pid[0], pid[1], new Hashtable<>(cfg))); } return configurations; }
public static List<Configuration> createConfigurations(BundleContext context, Map<String, Map<String, String>> configs) { List<Configuration> configurations = new ArrayList<>(); for (Map.Entry<String, Map<String, String>> entry : configs.entrySet()) { String pid[] = parsePid(entry.getKey()); Map<String, String> cfg = entry.getValue(); InterpolationHelper.performSubstitution(cfg, context); cfg.put(Constants.SERVICE_PID, pid[0]); configurations.add(new StaticConfigurationImpl(pid[0], pid[1], new Hashtable<>(cfg))); } return configurations; }
public String getHelp(final Session session, String path) { if (path == null) { path = "%root%"; } Map<String,String> props = new HashMap<>(); props.put("data", "${" + path + "}"); final List<HelpProvider> providers = session.getRegistry().getServices(HelpProvider.class); InterpolationHelper.performSubstitution(props, key -> { for (HelpProvider hp : providers) { String result = hp.getHelp(session, key); if (result != null) { return removeNewLine(result); } } return null; }); return props.get("data"); }
public String getHelp(final Session session, String path) { if (path == null) { path = "%root%"; } Map<String,String> props = new HashMap<>(); props.put("data", "${" + path + "}"); final List<HelpProvider> providers = session.getRegistry().getServices(HelpProvider.class); InterpolationHelper.performSubstitution(props, key -> { for (HelpProvider hp : providers) { String result = hp.getHelp(session, key); if (result != null) { return removeNewLine(result); } } return null; }); return props.get("data"); }