@Override
protected QueryNode postProcessNode(QueryNode node) throws QueryNodeException {
if (node instanceof WildcardQueryNode) {
WildcardQueryNode wildcardNode = (WildcardQueryNode) node;
if (wildcardNode.getText().length() > 0) {
// Validate if the wildcard was escaped
if (UnescapedCharSequence.wasEscaped(wildcardNode.getText(), 0))
return node;
switch (wildcardNode.getText().charAt(0)) {
case '*':
case '?':
throw new QueryNodeException(new MessageImpl(
QueryParserMessages.LEADING_WILDCARD_NOT_ALLOWED, node
.toQueryString(new EscapeQuerySyntaxImpl())));