/** * Lookup an existing resource configuration from the global config list. * <p/> * Note that this is resource config order-dependent. It will not locate configs that * have not yet been loaded. * * @param searchCriteria The resource lookup criteria. * @return List of matches resources, or an empty List if no matches are found. */ public List<SmooksResourceConfiguration> lookupResource(ConfigSearch searchCriteria) { return xmlConfigDigester.getResourceList().lookupResource(searchCriteria); } }
/** * Get the named parameter String value. * @param name Name of parameter to get. * @param config The {@link ContentDeliveryConfig} for the requesting device. * @return Parameter value, or null if not set. */ public static String getStringParameter(String name, ContentDeliveryConfig config) { Parameter param = getParamter(name, config); if(param != null) { return param.getValue(); } return null; }
/** * Set the named SmooksResourceConfiguration parameter value (default type - String). * <p/> * Overwrites previous value of the same name. * * @param name Parameter name. * @param value Parameter value. * @return The parameter instance. */ public Parameter setParameter(String name, String value) { Parameter param = new Parameter(name, value); setParameter(param); return param; }
private void digestReaderConfig(Element configElement, String defaultProfile) { String profiles = DomUtils.getAttributeValue(configElement, "targetProfile"); String readerClass = DomUtils.getAttributeValue(configElement, "class"); SmooksResourceConfiguration resourceConfig = new SmooksResourceConfiguration( "org.xml.sax.driver", (profiles != null ? profiles : defaultProfile), readerClass); // Add the reader resource... configureHandlers(configElement, resourceConfig); configureFeatures(configElement, resourceConfig); configureParams(configElement, resourceConfig); resourcelist.add(resourceConfig); }
public SmooksResourceConfigurationList getUserDefinedResourceList() { SmooksResourceConfigurationList userDefinedResources = new SmooksResourceConfigurationList("userDefinedResources"); for(SmooksResourceConfigurationList configList : configLists) { if(!configList.isSystemConfigList()) { userDefinedResources.addAll(configList); } } return userDefinedResources; } }
/** * 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 {@link ContentDeliveryConfig} for the requesting device. * @return true if the parameter is set to true, defaultVal if not defined, otherwise false. */ public static boolean getBoolParameter(String name, boolean defaultVal, ContentDeliveryConfig config) { Parameter param = getParamter(name, config); return toBoolean(param, defaultVal); }
/** * Is this resource a Java Class. * * @return True if this resource is a Java class, otherwise false. */ public boolean isJavaContentHandler() { Class runtimeClass = toJavaResource(); return (runtimeClass != null); }
/** * Get the active resource configuration list. * <p/> * This is the global config list i.e. not just the config list for the config * being processed. * * @return The active resource configuration list. */ public SmooksResourceConfigurationList getResourceList() { return xmlConfigDigester.getResourceList(); }
private void digestReaderConfig(Element configElement, String defaultProfile) { String profiles = DomUtils.getAttributeValue(configElement, "targetProfile"); String readerClass = DomUtils.getAttributeValue(configElement, "class"); SmooksResourceConfiguration resourceConfig = new SmooksResourceConfiguration( "org.xml.sax.driver", (profiles != null ? profiles : defaultProfile), readerClass); // Add the reader resource... configureHandlers(configElement, resourceConfig); configureFeatures(configElement, resourceConfig); configureParams(configElement, resourceConfig); resourcelist.add(resourceConfig); }
/** * Set the named SmooksResourceConfiguration parameter value (default type - String). * <p/> * Overwrites previous value of the same name. * * @param name Parameter name. * @param value Parameter value. * @return The parameter instance. */ public Parameter setParameter(String name, String value) { Parameter param = new Parameter(name, value); setParameter(param); return param; }
/** * Get the named parameter String value. * @param name Name of parameter to get. * @param config The {@link ContentDeliveryConfig} for the requesting device. * @return Parameter value, or null if not set. */ public static String getStringParameter(String name, ContentDeliveryConfig config) { Parameter param = getParamter(name, config); if(param != null) { return param.getValue(); } return null; }
/** * Lookup an existing resource configuration from the global config list. * <p/> * Note that this is resource config order-dependent. It will not locate configs that * have not yet been loaded. * * @param searchCriteria The resource lookup criteria. * @return List of matches resources, or an empty List if no matches are found. */ public List<SmooksResourceConfiguration> lookupResource(ConfigSearch searchCriteria) { return xmlConfigDigester.getResourceList().lookupResource(searchCriteria); } }
/** * Get the named parameter String value. * @param name Name of parameter to get. * @param config The {@link ContentDeliveryConfig} for the requesting device. * @return Parameter value, or null if not set. */ public static String getStringParameter(String name, ContentDeliveryConfig config) { Parameter param = getParamter(name, config); if(param != null) { return param.getValue(); } return null; }
/** * Lookup an existing resource configuration from the global config list. * * Note that this is resource config order-dependent. It will not locate configs that * have not yet been loaded. * * @param searchCriteria The resource lookup criteria. * @return List of matches resources, or an empty List if no matches are found. */ public List<SmooksResourceConfiguration> lookupResource(ConfigSearch searchCriteria) { return xmlConfigDigester.getResourceList().lookupResource(searchCriteria); } }
/** * Get the named parameter String value. * @param name Name of parameter to get. * @param config The {@link ContentDeliveryConfig} for the requesting device. * @return Parameter value, or null if not set. */ public static String getStringParameter(String name, ContentDeliveryConfig config) { Parameter param = getParamter(name, config); if(param != null) { return param.getValue(); } return null; }
/** * Lookup an existing resource configuration from the global config list. * <p/> * Note that this is resource config order-dependent. It will not locate configs that * have not yet been loaded. * * @param searchCriteria The resource lookup criteria. * @return List of matches resources, or an empty List if no matches are found. */ public List<SmooksResourceConfiguration> lookupResource(ConfigSearch searchCriteria) { return xmlConfigDigester.getResourceList().lookupResource(searchCriteria); } }
/** * Get the named parameter String value. * @param name Name of parameter to get. * @param defaultVal Default value returned if the parameter is not defined. * @param config The {@link ContentDeliveryConfig} for the requesting device. * @return Parameter value, or null if not set. */ public static String getStringParameter(String name, String defaultVal, ContentDeliveryConfig config) { Parameter param = getParamter(name, config); if(param != null) { return param.getValue(); } return defaultVal; }
/** * Get the named parameter String value. * @param name Name of parameter to get. * @param defaultVal Default value returned if the parameter is not defined. * @param config The {@link ContentDeliveryConfig} for the requesting device. * @return Parameter value, or null if not set. */ public static String getStringParameter(String name, String defaultVal, ContentDeliveryConfig config) { Parameter param = getParamter(name, config); if(param != null) { return param.getValue(); } return defaultVal; }
/** * Get the named parameter String value. * @param name Name of parameter to get. * @param defaultVal Default value returned if the parameter is not defined. * @param config The {@link ContentDeliveryConfig} for the requesting device. * @return Parameter value, or null if not set. */ public static String getStringParameter(String name, String defaultVal, ContentDeliveryConfig config) { Parameter param = getParamter(name, config); if(param != null) { return param.getValue(); } return defaultVal; }
/** * Get the named parameter instance (decode). * @param name Parameter name. * @param config Device Delivery Configuration. * @return The Parameter instance for the named parameter (<a href="#decode">decoded to an Object</a>), * or null if not defined. */ public static Object getParameterObject(String name, ContentDeliveryConfig config) { Parameter param = getParamter(name, config); if(param != null) { return param.getValue(config); } return null; }