private boolean isPrefixWildcard(CharSequence text) { if (text == null || text.length() <= 0 || !isWildcard(text)) return false; // Validate last character is a '*' and was not escaped // If single '*' is is a wildcard not prefix to simulate old queryparser if (text.charAt(text.length()-1) != '*') return false; if (UnescapedCharSequence.wasEscaped(text, text.length()-1)) return false; if (text.length() == 1) return false; // Only make a prefix if there is only one single star at the end and no '?' or '*' characters // If single wildcard return false to mimic old queryparser for(int i=0; i<text.length(); i++){ if (text.charAt(i) == '?') return false; if (text.charAt(i) == '*' && !UnescapedCharSequence.wasEscaped(text, i)){ if (i == text.length()-1) return true; else return false; } } return false; }
private boolean isPrefixWildcard(CharSequence text) { if (text == null || text.length() <= 0 || !isWildcard(text)) return false; // Validate last character is a '*' and was not escaped // If single '*' is is a wildcard not prefix to simulate old queryparser if (text.charAt(text.length()-1) != '*') return false; if (UnescapedCharSequence.wasEscaped(text, text.length()-1)) return false; if (text.length() == 1) return false; // Only make a prefix if there is only one single star at the end and no '?' or '*' characters // If single wildcard return false to mimic old queryparser for(int i=0; i<text.length(); i++){ if (text.charAt(i) == '?') return false; if (text.charAt(i) == '*' && !UnescapedCharSequence.wasEscaped(text, i)){ if (i == text.length()-1) return true; else return false; } } return false; }
return prefixWildcardQN; } else if (isWildcard(text)){ WildcardQueryNode wildcardQN = new WildcardQueryNode(fqn); return wildcardQN;
return prefixWildcardQN; } else if (isWildcard(text)){ WildcardQueryNode wildcardQN = new WildcardQueryNode(fqn); return wildcardQN;