/** * Trim all strings in a List. Changes the strings in the existing list. * @param list * @return List of trimmed strings. * @since 1.5 */ public static List trimStrings(List list) { if (list == null) return null; int sz = list.size(); for (int i = 0; i < sz; i++) list.set(i,nullTrim((String) list.get(i))); return list; }
/** * Trim all strings in a List. Changes the strings in the existing list. * @param list * @return List of trimmed strings. * @since 1.5 */ public static List trimStrings(List list) { if (list == null) return null; int sz = list.size(); for (int i = 0; i < sz; i++) list.set(i,nullTrim((String) list.get(i))); return list; }
/** * String property accessor method to hide the configuration implementation * @param key property key * @return value of key or null */ public String getString(String key) { return StringUtils.nullTrim(configuration.getString(key)); }
/** * @see org.apache.velocity.util.RuntimeServicesAware#setRuntimeServices(org.apache.velocity.runtime.RuntimeServices) */ public void setRuntimeServices(RuntimeServices rs) { this.rs = rs; notfound = StringUtils.nullTrim(rs.getString(PROPERTY_NOT_FOUND, DEFAULT_NOT_FOUND)); }
/** * String property accessor method to hide the configuration implementation * @param key property key * @return value of key or null */ public String getString(String key) { return StringUtils.nullTrim(configuration.getString(key)); }
/** * @see org.apache.velocity.util.RuntimeServicesAware#setRuntimeServices(org.apache.velocity.runtime.RuntimeServices) */ public void setRuntimeServices(RuntimeServices rs) { this.rs = rs; notfound = StringUtils.nullTrim(rs.getString(PROPERTY_NOT_FOUND, DEFAULT_NOT_FOUND)); }
protected VelocityBase(String templateName) { if (nullTrim(templateName) == null) throw new IllegalArgumentException("templateName not specified"); VelocityEngine ve = new VelocityEngine(); ve.setProperty(RuntimeConstants.RESOURCE_LOADER, "class,jar,file"); ve.setProperty("class.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader"); ve.setProperty("jar.resource.loader.class", "org.apache.velocity.runtime.resource.loader.JarResourceLoader"); File templateFile = new File(templateName); if (templateFile.isFile()) { ve.setProperty(RuntimeConstants.FILE_RESOURCE_LOADER_PATH, templateFile.getParent()); template = ve.getTemplate(templateFile.getName()); this.templateName = template==null ? null : templateFile.getAbsolutePath(); } else { template = ve.getTemplate(templateName); this.templateName = template==null ? null : templateName; } if(template == null) throw new ResourceNotFoundException("Neither file nor resource found for '"+templateName+"'"); }
return StringUtils.nullTrim((String) o);
return StringUtils.nullTrim((String) o);
dataSourceName = StringUtils.nullTrim(configuration.getString("resource.datasource")); tableName = StringUtils.nullTrim(configuration.getString("resource.table")); keyColumn = StringUtils.nullTrim(configuration.getString("resource.keycolumn")); templateColumn = StringUtils.nullTrim(configuration.getString("resource.templatecolumn")); timestampColumn = StringUtils.nullTrim(configuration.getString("resource.timestampcolumn"));
dataSourceName = StringUtils.nullTrim(configuration.getString("resource.datasource")); tableName = StringUtils.nullTrim(configuration.getString("resource.table")); keyColumn = StringUtils.nullTrim(configuration.getString("resource.keycolumn")); templateColumn = StringUtils.nullTrim(configuration.getString("resource.templatecolumn")); timestampColumn = StringUtils.nullTrim(configuration.getString("resource.timestampcolumn"));
String value = StringUtils.nullTrim(source.getString(name)); contextProperties.setProperty(name,value);
String value = StringUtils.nullTrim(source.getString(name)); contextProperties.setProperty(name,value);
matchRegExp = StringUtils.nullTrim(rs.getConfiguration().getString(getMatchAttribute())); if ((matchRegExp != null) && (matchRegExp.length() == 0))
matchRegExp = StringUtils.nullTrim(rs.getConfiguration().getString(getMatchAttribute())); if ((matchRegExp != null) && (matchRegExp.length() == 0))
String value = StringUtils.nullTrim(contextProperties.getString(property));
String loaderClass = StringUtils.nullTrim(configuration.getString("class")); ResourceLoader loaderInstance = (ResourceLoader) configuration.get("instance");
String value = StringUtils.nullTrim(contextProperties.getString(property));
String loaderClass = StringUtils.nullTrim(configuration.getString("class")); ResourceLoader loaderInstance = (ResourceLoader) configuration.get("instance");