@Override public boolean matches(char c) { return Character.isLetter(c); }
protected boolean shouldQuote(String string) { boolean ws = false; for (int ii = 0; ii < string.length(); ii++) { final char ch = string.charAt(ii); if (ii==0 && !Character.isLetter(ch) ) return true; if (!Character.isLetterOrDigit(ch) && ch != '_' && ch != '-' && ch != '(' && ch != ')' && ch != '[' && ch != ']' && ch != '.') { ws = true; break; } } return ws; }
@Override public boolean matches(char c) { return Character.isLetter(c); }
protected boolean isIdStart(int ch) { return Character.isLetter(ch) || ch == '$' || ch == '#' || ch == '_'; }
@Override public boolean matches(char c) { return Character.isLetter(c); }
/** * Does the supplied content contain an XML opening tag. If the parse state is currently * in an XML comment then this method always returns false. It is expected that all comment * tokens will have consumed for the supplied content before passing the remainder to this method. */ private boolean hasOpeningTag(String content) { if (this.inComment) { return false; } int openTagIndex = content.indexOf('<'); return (openTagIndex > -1 && (content.length() > openTagIndex + 1) && Character.isLetter(content.charAt(openTagIndex + 1))); }
protected static boolean containsLetter(String s) { if (s == null) { return false; } for (int i = 0, len = s.length(); i < len; i++) { if (Character.isLetter(s.charAt(i))) { return true; } } return false; }
/** * Returns whether a part of speech tag is the tag for a punctuation mark (by * checking whether the first character is a letter. * * @param label * part of speech tag * @return whether the tag is (typically) assigned to punctuation */ private boolean isPunctuationLabel(String label) { return !Character.isLetter(label.charAt(0)) && !(label.equals("$") || label.equals("%")); }
private static boolean hasLetter(String str) { if (str.length() < 1) { return false; } for (int i = 0; i < str.length(); i++) { if (Character.isLetter(str.charAt(i))) { return true; } } return false; }
private static int hasApostropheBlock(String s) { for(int i = s.length() - 1; i > 0; i --){ if(s.charAt(i) == '\'' && i < s.length() - 1){ return i; } if(! Character.isLetter(s.charAt(i))){ return -1; } } return -1; }
protected static boolean containsAlphanumeric(String s) { if (s == null) { return false; } for (int i = 0, len = s.length(); i < len; i++) { if (Character.isLetter(s.charAt(i)) || Character.isDigit(s.charAt(i))) { return true; } } return false; }
static String clean(String str) { if (str == null || str.length() == 0) { return str; } int len = str.length(); char[] chars = new char[len]; int count = 0; for (int i = 0; i < len; i++) { if (Character.isLetter(str.charAt(i))) { chars[count++] = str.charAt(i); } } if (count == len) { return str.toUpperCase(java.util.Locale.ENGLISH); } return new String(chars, 0, count).toUpperCase(java.util.Locale.ENGLISH); }
public List<URL> getCacheUrls(URL url) { for (Map.Entry<Object, Object> entry : properties.entrySet()) { String key = (String) entry.getKey(); String value = (String) entry.getValue(); if (key != null && key.length() > 0 && key.equals(url.getServiceKey()) && (Character.isLetter(key.charAt(0)) || key.charAt(0) == '_') && value != null && value.length() > 0) { String[] arr = value.trim().split(URL_SPLIT); List<URL> urls = new ArrayList<>(); for (String u : arr) { urls.add(URL.valueOf(u)); } return urls; } } return null; }
public List<URL> getCacheUrls(URL url) { for (Map.Entry<Object, Object> entry : properties.entrySet()) { String key = (String) entry.getKey(); String value = (String) entry.getValue(); if (key != null && key.length() > 0 && key.equals(url.getServiceKey()) && (Character.isLetter(key.charAt(0)) || key.charAt(0) == '_') && value != null && value.length() > 0) { String[] arr = value.trim().split(URL_SPLIT); List<URL> urls = new ArrayList<>(); for (String u : arr) { urls.add(URL.valueOf(u)); } return urls; } } return null; }
private static boolean checkPrefix(@Nullable String name, @NotNull String prefix) { // https://github.com/golang/go/blob/master/src/cmd/go/test.go#L1161 – isTest() if (name == null || !name.startsWith(prefix)) return false; if (prefix.length() == name.length()) return true; char c = name.charAt(prefix.length()); return !Character.isLetter(c) || !Character.isLowerCase(c); } }
@Override protected int nextEscapeIndex(CharSequence csq, int index, int end) { while (index < end && !Character.isLetter(csq.charAt(index))) { index++; } return index; } };
private static void validateParamChar(char cc, int idx) { if (!(isDigit(cc) || isLetter(cc) || '.' == cc)) throw UncheckedTemplateException.invalidCharacterInParam(cc, idx); } }
private static void validateParamChar(char cc, int idx) { if (!(isDigit(cc) || isLetter(cc) || '.' == cc)) throw UncheckedTemplateException.invalidCharacterInParam(cc, idx); } }
private boolean START_sempred(RuleContext _localctx, int predIndex) { switch (predIndex) { case 4: return recognizeXmlTags && (Character.isLetter(_input.LA(1)) || _input.LA(1) == '/'); } return true; } private boolean AUTHOR_LITERAL_sempred(RuleContext _localctx, int predIndex) {
public final void nextIdent() { while (isWhitespace(ch)) { next(); } if (ch == '_' || ch == '$' || Character.isLetter(ch)) { scanIdent(); } else { nextToken(); } }