/** * Get the named SmooksResourceConfiguration parameter as a boolean. * @param name Name of parameter to get. * @param defaultVal The default value to be returned if there are no * parameters on the this SmooksResourceConfiguration instance, or the parameter is not defined. * @param config The config map. * @return true if the parameter is set to true, defaultVal if not defined, otherwise false. */ public static boolean getBoolParameter(String name, boolean defaultVal, Map<String, List<SmooksResourceConfiguration>> config) { Parameter param = getParameter(name, config); return toBoolean(param, defaultVal); }
/** * Get the named SmooksResourceConfiguration parameter as a boolean. * @param name Name of parameter to get. * @param defaultVal The default value to be returned if there are no * parameters on the this SmooksResourceConfiguration instance, or the parameter is not defined. * @param config The config map. * @return true if the parameter is set to true, defaultVal if not defined, otherwise false. */ public static boolean getBoolParameter(String name, boolean defaultVal, Map<String, List<SmooksResourceConfiguration>> config) { Parameter param = getParameter(name, config); return toBoolean(param, defaultVal); }
/** * Get the named SmooksResourceConfiguration parameter as a boolean. * @param name Name of parameter to get. * @param defaultVal The default value to be returned if there are no * parameters on the this SmooksResourceConfiguration instance, or the parameter is not defined. * @param config The config map. * @return true if the parameter is set to true, defaultVal if not defined, otherwise false. */ public static boolean getBoolParameter(String name, boolean defaultVal, Map<String, List<SmooksResourceConfiguration>> config) { Parameter param = getParameter(name, config); return toBoolean(param, defaultVal); }
/** * Get the named SmooksResourceConfiguration parameter as a boolean. * @param name Name of parameter to get. * @param defaultVal The default value to be returned if there are no * parameters on the this SmooksResourceConfiguration instance, or the parameter is not defined. * @param config The config map. * @return true if the parameter is set to true, defaultVal if not defined, otherwise false. */ public static boolean getBoolParameter(String name, boolean defaultVal, Map<String, List<SmooksResourceConfiguration>> config) { Parameter param = getParameter(name, config); return toBoolean(param, defaultVal); }
/** * Get the named parameter from the supplied resource config map. * * @param name The parameter name. * @param resourceConfigurations The resource configuration map. * @return The parameter value, or null if not found. */ public static String getStringParameter(String name, Map<String, List<SmooksResourceConfiguration>> resourceConfigurations) { Parameter parameter = getParameter(name, resourceConfigurations); if(parameter != null) { return parameter.getValue(); } return null; }
/** * Get the named parameter from the supplied resource config map. * * @param name The parameter name. * @param resourceConfigurations The resource configuration map. * @return The parameter value, or null if not found. */ public static String getStringParameter(String name, Map<String, List<SmooksResourceConfiguration>> resourceConfigurations) { Parameter parameter = getParameter(name, resourceConfigurations); if(parameter != null) { return parameter.getValue(); } return null; }
/** * Get the named parameter from the supplied resource config map. * * @param name The parameter name. * @param resourceConfigurations The resource configuration map. * @return The parameter value, or null if not found. */ public static String getStringParameter(String name, Map<String, List<SmooksResourceConfiguration>> resourceConfigurations) { Parameter parameter = getParameter(name, resourceConfigurations); if(parameter != null) { return parameter.getValue(); } return null; }
/** * Get the named parameter from the supplied resource config map. * * @param name The parameter name. * @param resourceConfigurations The resource configuration map. * @return The parameter value, or null if not found. */ public static String getStringParameter(String name, Map<String, List<SmooksResourceConfiguration>> resourceConfigurations) { Parameter parameter = getParameter(name, resourceConfigurations); if(parameter != null) { return parameter.getValue(); } return null; }
/** * Iterate over the table smooks-resource instances and sort the SmooksResourceConfigurations * on each element. Ordered by specificity. */ @SuppressWarnings("unchecked") private void sortSmooksResourceConfigurations(Map<String, List<SmooksResourceConfiguration>> table) { Parameter sortParam = ParameterAccessor.getParameter("sort.resources", table); if(sortParam != null && sortParam.getValue().trim().equalsIgnoreCase("true")) { if(!table.isEmpty()) { for (final Object o : table.entrySet()) { Entry entry = (Entry) o; List markupElSmooksResourceConfigurations = (List) entry.getValue(); SmooksResourceConfiguration[] resourceConfigs = (SmooksResourceConfiguration[]) markupElSmooksResourceConfigurations .toArray(new SmooksResourceConfiguration[0]); SmooksResourceConfigurationSortComparator sortComparator = new SmooksResourceConfigurationSortComparator(profileSet); Arrays.sort(resourceConfigs, sortComparator); entry.setValue(new Vector(Arrays.asList(resourceConfigs))); } } } }
/** * Iterate over the table smooks-resource instances and sort the SmooksResourceConfigurations * on each element. Ordered by specificity. */ @SuppressWarnings("unchecked") private void sortSmooksResourceConfigurations(Map<String, List<SmooksResourceConfiguration>> table) { Parameter sortParam = ParameterAccessor.getParameter("sort.resources", table); if(sortParam != null && sortParam.getValue().trim().equalsIgnoreCase("true")) { if(!table.isEmpty()) { for (final Object o : table.entrySet()) { Entry entry = (Entry) o; List markupElSmooksResourceConfigurations = (List) entry.getValue(); SmooksResourceConfiguration[] resourceConfigs = (SmooksResourceConfiguration[]) markupElSmooksResourceConfigurations .toArray(new SmooksResourceConfiguration[0]); SmooksResourceConfigurationSortComparator sortComparator = new SmooksResourceConfigurationSortComparator(profileSet); Arrays.sort(resourceConfigs, sortComparator); entry.setValue(new Vector(Arrays.asList(resourceConfigs))); } } } }
/** * Iterate over the table smooks-resource instances and sort the SmooksResourceConfigurations * on each element. Ordered by specificity. */ private void sortSmooksResourceConfigurations(Map<String, List<SmooksResourceConfiguration>> table) { Parameter sortParam = ParameterAccessor.getParameter("sort.resources", table); if(sortParam != null && sortParam.getValue().trim().equalsIgnoreCase("true")) { if(!table.isEmpty()) { Iterator tableEntrySet = table.entrySet().iterator(); while(tableEntrySet.hasNext()) { Map.Entry entry = (Map.Entry)tableEntrySet.next(); List markupElSmooksResourceConfigurations = (List)entry.getValue(); SmooksResourceConfiguration[] resourceConfigs = (SmooksResourceConfiguration[])markupElSmooksResourceConfigurations.toArray(new SmooksResourceConfiguration[markupElSmooksResourceConfigurations.size()]); SmooksResourceConfigurationSortComparator sortComparator = new SmooksResourceConfigurationSortComparator(profileSet); Arrays.sort(resourceConfigs, sortComparator); entry.setValue(new Vector(Arrays.asList(resourceConfigs))); } } } }
/** * Iterate over the table smooks-resource instances and sort the SmooksResourceConfigurations * on each element. Ordered by specificity. */ @SuppressWarnings("unchecked") private void sortSmooksResourceConfigurations(Map<String, List<SmooksResourceConfiguration>> table) { Parameter sortParam = ParameterAccessor.getParameter("sort.resources", table); if(sortParam != null && sortParam.getValue().trim().equalsIgnoreCase("true")) { if(!table.isEmpty()) { for (final Object o : table.entrySet()) { Entry entry = (Entry) o; List markupElSmooksResourceConfigurations = (List) entry.getValue(); SmooksResourceConfiguration[] resourceConfigs = (SmooksResourceConfiguration[]) markupElSmooksResourceConfigurations .toArray(new SmooksResourceConfiguration[0]); SmooksResourceConfigurationSortComparator sortComparator = new SmooksResourceConfigurationSortComparator(profileSet); Arrays.sort(resourceConfigs, sortComparator); entry.setValue(new Vector(Arrays.asList(resourceConfigs))); } } } }
/** * Get the named parameter. * <p/> * Calls {@link org.milyn.delivery.ContentDeliveryConfig#getSmooksResourceConfigurations()} * to get the configurations map and then passes that to * {@link #getParameter(String, java.util.Map)}, returning its return value. * * @param name Parameter name. * @param config Device Delivery Configuration. * @return The Parameter instance for the named parameter, or null if not defined. */ public static Parameter getParamter(String name, ContentDeliveryConfig config) { AssertArgument.isNotNullAndNotEmpty(name, "name"); AssertArgument.isNotNull(config, "config"); return getParameter(name, config.getSmooksResourceConfigurations()); }
/** * Get the named parameter. * <p/> * Calls {@link org.milyn.delivery.ContentDeliveryConfig#getSmooksResourceConfigurations()} * to get the configurations map and then passes that to * {@link #getParameter(String, java.util.Map)}, returning its return value. * * @param name Parameter name. * @param config Device Delivery Configuration. * @return The Parameter instance for the named parameter, or null if not defined. */ public static Parameter getParamter(String name, ContentDeliveryConfig config) { AssertArgument.isNotNullAndNotEmpty(name, "name"); AssertArgument.isNotNull(config, "config"); return getParameter(name, config.getSmooksResourceConfigurations()); }
/** * Get the named parameter. * <p/> * Calls {@link org.milyn.delivery.ContentDeliveryConfig#getSmooksResourceConfigurations()} * to get the configurations map and then passes that to * {@link #getParameter(String, java.util.Map)}, returning its return value. * * @param name Parameter name. * @param config Device Delivery Configuration. * @return The Parameter instance for the named parameter, or null if not defined. */ public static Parameter getParamter(String name, ContentDeliveryConfig config) { AssertArgument.isNotNullAndNotEmpty(name, "name"); AssertArgument.isNotNull(config, "config"); return getParameter(name, config.getSmooksResourceConfigurations()); }
/** * Get the named parameter. * * Calls {@link org.milyn.delivery.ContentDeliveryConfig#getSmooksResourceConfigurations()} * to get the configurations map and then passes that to * {@link #getParameter(String, java.util.Map)}, returning its return value. * * @param name Parameter name. * @param config Device Delivery Configuration. * @return The Parameter instance for the named parameter, or null if not defined. */ public static Parameter getParamter(String name, ContentDeliveryConfig config) { AssertArgument.isNotNullAndNotEmpty(name, "name"); AssertArgument.isNotNull(config, "config"); return getParameter(name, config.getSmooksResourceConfigurations()); }