List of usage examples for org.apache.commons.lang CharUtils isAsciiAlphaUpper
public static boolean isAsciiAlphaUpper(char ch)
Checks whether the character is ASCII 7 bit alphabetic upper case.
From source file:com.phoenixnap.oss.ramlapisync.style.checkers.ResourceUrlStyleChecker.java
@Override public Set<StyleIssue> checkResourceStyle(String name, Resource resource, IssueLocation location) { logger.debug("Checking resource " + name); Set<StyleIssue> issues = new LinkedHashSet<>(); if (!NamingHelper.isUriParamResource(name) && CHARS_NOT_ALLOWED.matcher(name).find()) { issues.add(new StyleIssue(location, SPECIAL_CHARS_IN_URL, resource, null)); }/*from w w w . j a v a 2s . c o m*/ if (CharUtils.isAsciiAlphaUpper(name.charAt(0))) { issues.add(new StyleIssue(location, CAPITALISED_RESOURCE, resource, null)); } return issues; }
From source file:net.ravendb.client.RavenDBAwareTests.java
protected String getDbName() { String method = testName.getMethodName(); StringBuilder dbName = new StringBuilder(); if (method.length() > 15) { dbName.append(method.substring(0, 10)); for (int i = 10; i < method.length() - 2; i++) { if (CharUtils.isAsciiAlphaUpper(method.charAt(i))) { dbName.append(method.charAt(i)); if (CharUtils.isAsciiAlphaLower(method.charAt(i + 1))) { dbName.append(method.charAt(i + 1)); }// w w w . j a v a2 s . c om } if ('_' == method.charAt(i)) { dbName.append(CharUtils.toString(method.charAt(i + 1)).toUpperCase()); dbName.append(method.charAt(i + 2)); i++; } } } else { return method; } return dbName.toString(); }
From source file:org.jiemamy.utils.reflect.ReflectionUtil.java
/** * ?getter?????/*from ww w . j a v a 2s . c om*/ * * @param method * @return getter???{@code true} * @throws IllegalArgumentException ?{@code null}??? */ public static boolean isGetter(Method method) { Validate.notNull(method); Class<?>[] parameterTypes = method.getParameterTypes(); if (parameterTypes.length != 0) { return false; } Class<?> returnType = method.getReturnType(); String name = method.getName(); if (returnType == void.class || returnType == Void.class) { return false; } else if (returnType == boolean.class || returnType == Boolean.class) { boolean result = name.startsWith(IS) && name.length() > 2 && CharUtils.isAsciiAlphaUpper(name.toCharArray()[2]); if (result == true) { return true; } } return name.startsWith(GET) && name.length() > 3 && CharUtils.isAsciiAlphaUpper(name.toCharArray()[3]); }
From source file:org.jiemamy.utils.reflect.ReflectionUtil.java
/** * ?setter?????//from w ww. jav a 2 s .com * * @param method * @return setter???{@code true} * @throws IllegalArgumentException ?{@code null}??? */ public static boolean isSetter(Method method) { Validate.notNull(method); Class<?>[] parameterTypes = method.getParameterTypes(); if (parameterTypes.length != 1) { return false; } Class<?> returnType = method.getReturnType(); if (returnType != void.class && returnType != Void.class) { return false; } String name = method.getName(); return name.startsWith(SET) && name.length() > 3 && CharUtils.isAsciiAlphaUpper(name.toCharArray()[3]); }
From source file:org.metaabm.ide.AgentImporter.java
protected final static String insertSpaces(String propertyName) { StringBuilder propertyBuilder = new StringBuilder(); boolean lastLower = false; for (char c : propertyName.toCharArray()) { if (lastLower && CharUtils.isAsciiAlphaUpper(c)) { propertyBuilder.append(' '); } else {//from w ww . j a v a 2 s .co m lastLower = true; } propertyBuilder.append(c); } return propertyBuilder.toString(); }
From source file:org.zoolu.tools.Parser.java
/** * Compares two chars ignoring case/*ww w . ja va2 s. c om*/ * * @param c1 * @param c2 * @return */ public static int compareIgnoreCase(char c1, char c2) { if (CharUtils.isAsciiAlphaUpper(c1)) { c1 += 32; } if (CharUtils.isAsciiAlphaUpper(c2)) { c2 += 32; } return c1 - c2; }
From source file:stirling.fix.messages.fix42.DefaultMessageFactory.java
private boolean isValidWide(String msgType) { char first = msgType.charAt(0); if (first != 'A') return false; char second = msgType.charAt(1); if (!CharUtils.isAsciiAlphaUpper(second)) return false; return second >= 'A' && second <= 'I'; }