/** * As with {@link #isBlank(String)}, but inverts the response. */ public static boolean isNonBlank(String string) { return !isBlank(string); }
private String extractName(String uri, String localName, String qName) { return HiveMind.isBlank(localName) ? qName : localName; }
private String extractName(String uri, String localName, String qName) { return HiveMind.isBlank(localName) ? qName : localName; }
protected String getAttribute(Attributes attributes, String name) { int count = attributes.getLength(); for (int i = 0; i < count; i++) { String attributeName = attributes.getLocalName(i); if (HiveMind.isBlank(attributeName)) attributeName = attributes.getQName(i); if (attributeName.equals(name)) return attributes.getValue(i); } return null; }
public Object translate(Module contributingModule, Class propertyType, String inputValue, Location location) { if (HiveMind.isBlank(inputValue)) return null; return InstanceCreationUtils.createInstance(contributingModule, inputValue, location); }
public void init(FilterConfig config) throws ServletException { _redirectPath = config.getInitParameter(REDIRECT_PATH_PARAM); if (HiveMind.isBlank(_redirectPath)) _redirectPath = "/app"; if (LOG.isDebugEnabled()) LOG.debug(Tapestry.format("RedirectServlet.redirect-path", _redirectPath)); }
public void init(FilterConfig config) throws ServletException { _redirectPath = config.getInitParameter(REDIRECT_PATH_PARAM); if (HiveMind.isBlank(_redirectPath)) _redirectPath = "/app"; if (LOG.isDebugEnabled()) LOG.debug(Tapestry.format("RedirectServlet.redirect-path", _redirectPath)); }
public Object createStateObject() { if (HiveMind.isBlank(getClassName())) return Collections.synchronizedMap(new HashMap()); return super.createStateObject(); } }
public Object createStateObject() { if (HiveMind.isBlank(getClassName())) return Collections.synchronizedMap(new HashMap()); return super.createStateObject(); } }
/** * @see org.apache.tapestry.form.translator.Translator#parse(org.apache.tapestry.form.IFormComponent, * ValidationMessages, java.lang.String) */ public Object parse(IFormComponent field, ValidationMessages messages, String text) throws ValidatorException { String value = text == null ? null : (_trim ? text.trim() : text); return HiveMind.isBlank(value) ? getValueForEmptyInput() : parseText(field, messages, value); }
/** * @see org.apache.tapestry.form.translator.Translator#parse(org.apache.tapestry.form.IFormComponent, * ValidationMessages, java.lang.String) */ public Object parse(IFormComponent field, ValidationMessages messages, String text) throws ValidatorException { String value = text == null ? null : (_trim ? text.trim() : text); return HiveMind.isBlank(value) ? getValueForEmptyInput() : parseText(field, messages, value); }
/** * @see org.apache.tapestry.form.translator.Translator#parse(org.apache.tapestry.form.IFormComponent, * ValidationMessages, java.lang.String) */ public Object parse(IFormComponent field, ValidationMessages messages, String text) throws ValidatorException { String value = text == null ? null : (_trim ? text.trim() : text); return HiveMind.isBlank(value) ? getValueForEmptyInput() : parseText(field, messages, value); }
public FormatTranslator(String initializer) { PropertyUtils.configureProperties(this, initializer); if (HiveMind.isBlank(_pattern)) { _pattern = defaultPattern(); } }
/** * Invoked to check if the value is null. If the value is null (or empty), but the required flag * is set, then this method throws a {@link ValidatorException}. Otherwise, returns true if the * value is null. */ protected boolean checkRequired(IFormComponent field, String value) throws ValidatorException { boolean isEmpty = HiveMind.isBlank(value); if (_required && isEmpty) throw new ValidatorException(buildRequiredMessage(field), ValidationConstraint.REQUIRED); return isEmpty; }
/** * Invoked to check if the value is null. If the value is null (or empty), but the required flag * is set, then this method throws a {@link ValidatorException}. Otherwise, returns true if the * value is null. */ protected boolean checkRequired(IFormComponent field, String value) throws ValidatorException { boolean isEmpty = HiveMind.isBlank(value); if (_required && isEmpty) throw new ValidatorException(buildRequiredMessage(field), ValidationConstraint.REQUIRED); return isEmpty; }
public FormatTranslator(String initializer) { PropertyUtils.configureProperties(this, initializer); if (HiveMind.isBlank(_pattern)) { _pattern = defaultPattern(); } }
public void forward(String URL) { if (HiveMind.isBlank(URL)) { performForward("/"); return; } boolean internal = !(URL.startsWith("/") || URL.indexOf("://") > 0); if (internal) performForward("/" + URL); else sendRedirect(URL); }
/** * Qualifies a list of interceptor service ids provided for an interceptor contribution. The * special value "*" is not qualified. */ public static String qualifyList(String sourceModuleId, String list) { if (HiveMind.isBlank(list) || list.equals("*")) return list; String[] items = StringUtils.split(list); for (int i = 0; i < items.length; i++) items[i] = qualify(sourceModuleId, items[i]); return StringUtils.join(items, ','); }
public Object translate(Module contributingModule, Class propertyType, String inputValue, Location location) { if (HiveMind.isBlank(inputValue)) return null; if (propertyType == Map.class && contributingModule.isConfigurationMappable(inputValue)) return contributingModule.getConfigurationAsMap(inputValue); return contributingModule.getConfiguration(inputValue); } }
private IAsset findAsset(String path, String description) { IAsset asset = null; if ( !HiveMind.isBlank(path) ) { Location location = new DescribedLocation(new URLResource(path), description); asset = _assetSource.findAsset(null, path, null, location); } return asset; }