public PropertyModel label(String label) { assert InternalCommonsUtils.isNonBlank(label); this.label = label; return this; }
public static boolean isNonBlank(String input) { return InternalCommonsUtils.isNonBlank(input); }
public static boolean isNonBlank(String input) { return InternalCommonsUtils.isNonBlank(input); }
/** * Searches the string for the final period ('.') character and returns everything after that. The input string is * generally a fully qualified class name, though tapestry-core also uses this method for the occasional property * expression (which is also dot separated). Returns the input string unchanged if it does not contain a period * character. */ public static String lastTerm(String input) { assert isNonBlank(input); int dotx = input.lastIndexOf('.'); if (dotx < 0) return input; return input.substring(dotx + 1); }
/** * Strips leading "_" and "$" and trailing "_" from the name. */ public static String stripMemberName(String memberName) { assert InternalCommonsUtils.isNonBlank(memberName); Matcher matcher = NAME_PATTERN.matcher(memberName); if (!matcher.matches()) throw new IllegalArgumentException(String.format("Input '%s' is not a valid Java identifier.", memberName)); return matcher.group(1); }
private void validateNewPropertyName(String propertyName) { assert InternalCommonsUtils.isNonBlank(propertyName); if (properties.containsKey(propertyName)) throw new RuntimeException(String.format( "Bean editor model for %s already contains a property model for property '%s'.", beanType.getName(), propertyName)); }
public PropertyConduit create(Class rootClass, String expression) { assert rootClass != null; assert InternalCommonsUtils.isNonBlank(expression); MultiKey key = new MultiKey(rootClass, expression); PropertyConduit result = cache.get(key); if (result == null) { result = build(rootClass, expression); cache.put(key, result); } return result; }
/** * Extracts the service id from the passed annotated element. First the {@link ServiceId} annotation is checked. * If present, its value is returned. Otherwise {@link Named} annotation is checked. If present, its value is * returned. * If neither of the annotations is present, <code>null</code> value is returned * * @param annotated * annotated element to get annotations from * @since 5.3 */ public static String getServiceId(AnnotatedElement annotated) { ServiceId serviceIdAnnotation = annotated.getAnnotation(ServiceId.class); if (serviceIdAnnotation != null) { return serviceIdAnnotation.value(); } Named namedAnnotation = annotated.getAnnotation(Named.class); if (namedAnnotation != null) { String value = namedAnnotation.value(); if (InternalCommonsUtils.isNonBlank(value)) { return value; } } return null; }
/** * Extracts the service id from the passed annotated element. First the {@link ServiceId} annotation is checked. * If present, its value is returned. Otherwise {@link Named} annotation is checked. If present, its value is * returned. * If neither of the annotations is present, <code>null</code> value is returned * * @param annotated * annotated element to get annotations from * @since 5.3 */ public static String getServiceId(AnnotatedElement annotated) { ServiceId serviceIdAnnotation = annotated.getAnnotation(ServiceId.class); if (serviceIdAnnotation != null) { return serviceIdAnnotation.value(); } Named namedAnnotation = annotated.getAnnotation(Named.class); if (namedAnnotation != null) { String value = namedAnnotation.value(); if (InternalCommonsUtils.isNonBlank(value)) { return value; } } return null; }
assert InternalCommonsUtils.isNonBlank(description);