List of usage examples for org.apache.commons.lang StringUtils isBlank
public static boolean isBlank(String str)
Checks if a String is whitespace, empty ("") or null.
From source file:com.googlecode.jtiger.modules.ecside.core.bean.ColumnDefaults.java
static String getCell(TableModel model, String cell) { String result;/*from www .ja va 2s . c o m*/ if (StringUtils.isNotBlank(cell)) { result = model.getPreferences().getPreference(PreferencesConstants.COLUMN_CELL + cell); if (StringUtils.isBlank(result)) { result = cell; } } else { result = model.getPreferences() .getPreference(PreferencesConstants.COLUMN_CELL + TableConstants.CELL_DISPLAY); } return result; }
From source file:gov.nih.nci.caarray.magetab.TermSource.java
/** * Create new TermSource with given name. * @param name the repository name; must not be blank or null *//*from w ww . j av a 2 s . com*/ public TermSource(String name) { if (StringUtils.isBlank(name)) { throw new IllegalArgumentException("Term source name must not be blank"); } this.name = name; }
From source file:com.baidu.rigel.biplatform.cache.StoreManager.java
/** * cache?KEY???//from w ww. j a v a 2 s .c o m * * @param cache * ?cache * @param key * key * @param clazz * ? * @return * @throws IllegalArgumentException * ? */ @SuppressWarnings("unchecked") public static <T> T getFromCache(Cache cache, String key, Class<T> clazz) { if (cache == null || StringUtils.isBlank(key)) { throw new IllegalArgumentException("illegal params ,cache:" + cache + " key:" + key); } ValueWrapper valueWrapper = cache.get(key); if (valueWrapper != null) { return (T) valueWrapper.get(); } return null; }
From source file:de.shadowhunt.sonar.plugins.ignorecode.model.IssuePattern.java
/** * Create a list of {@link IssuePattern} from the given {@link InputStream} * * @param input containing one {@link IssuePattern} per line (for a description of the * line format see {@link #parseLine(String)}. Empty lines or comments (lines starting * with '#') are ignored/*from w ww .ja va 2 s .c om*/ * * @return the list of {@link IssuePattern} from the given {@link InputStream} * * @throws IOException in case the {@link InputStream} can not be read */ public static List<IssuePattern> parse(final InputStream input) throws IOException { final List<IssuePattern> patterns = new ArrayList<>(); for (final String line : IOUtils.readLines(input)) { if (StringUtils.isBlank(line) || (line.charAt(0) == '#')) { continue; } final IssuePattern pattern = parseLine(line); patterns.add(pattern); } return patterns; }
From source file:com.ultrapower.eoms.common.plugin.ecside.core.bean.ColumnDefaults.java
static String getCell(TableModel model, String cell) { String result;//from www .j ava 2 s.c o m if (StringUtils.isNotBlank(cell)) { result = model.getPreferences().getPreference(PreferencesConstants.COLUMN_CELL + cell); if (StringUtils.isBlank(result)) { result = cell; } } else { result = model.getPreferences().getPreference(PreferencesConstants.COLUMN_CELL + TableConstants.CELL_DISPLAY); } return result; }
From source file:com.bsb.cms.content.service.utils.PublishUtil.java
public static String getPublishDir(ContTypeDTO type) { String dir;//from w w w .ja v a2s. c o m if (StringUtils.isBlank(type.getFile_dir())) { dir = String.valueOf(type.getId()); } else { dir = type.getFile_dir(); } ConfigUtils config = (ConfigUtils) SpringContextUtil.getApplicationContextInstance().getBean("configUtils", ConfigUtils.class); return config.getRootPath() + dir + "/"; }
From source file:ips1ap101.lib.core.jsf.component.HipervinculoBuscar.java
private boolean isRenderedToo() { String script = this.getOnClick(); WebuiInput sibling = getSibling();/* www.j a va 2 s . c o m*/ return StringUtils.isBlank(script) ? false : sibling instanceof TextField ? sibling.isRendered() && !((TextField) sibling).isReadOnly() : true; }
From source file:com.googlecode.gmaps4jsf.jsfplugin.util.FacesMojoUtils.java
public static String getPrimitiveMethod(String type) { String toPrimitiveMethod = (String) toPrimitiveMap.get(type); if (StringUtils.isBlank(toPrimitiveMethod)) return StringUtils.EMPTY; //if none found just return the same type else//from ww w. ja va 2 s .com return toPrimitiveMethod; }
From source file:com.switchfly.inputvalidation.canonicalizer.HtmlAndQueryStringCanonicalizer.java
@Override public String execute(String content) { if (StringUtils.isBlank(content)) { return content; }/*from ww w. ja v a 2 s .c o m*/ String s = super.execute(content); try { s = StringEscapeUtils.unescapeHtml(s); } catch (Exception e) { throw new IllegalArgumentException("Canonicalization error", e); } try { s = URLDecoder.decode(s, "UTF-8"); } catch (Exception e) { // ignore and move on } return s; }
From source file:biblivre3.marcutils.MarcReader.java
public static String detectSplitter(final String marc) { // Try to detect the first split. if (!StringUtils.isBlank(marc)) { String[] lines = marc.split("\n"); for (String line : lines) { line = line.trim();// w ww . j a v a2s. c o m if (line.length() > 7) { char separator = line.charAt(6); if (separator == '|' || separator == '$') { return String.valueOf(separator); } } } } return ApplicationConstants.DEFAULT_SPLITTER; }