private QueryNode applyModifier(QueryNode node, ModifierQueryNode.Modifier mod) { // check if modifier is not already defined and is default if (!(node instanceof ModifierQueryNode)) { return new ModifierQueryNode(node, mod); } else { ModifierQueryNode modNode = (ModifierQueryNode) node; if (modNode.getModifier() == ModifierQueryNode.Modifier.MOD_NONE) { return new ModifierQueryNode(modNode.getChild(), mod); } } return node; }
public QueryNode getChild() { return getChildren().get(0); }
public void setChild(QueryNode child) { List<QueryNode> list = new ArrayList<>(); list.add(child); this.set(list); }
@Override protected QueryNode preProcessNode(final QueryNode node) throws QueryNodeException { if (node instanceof ModifierQueryNode) { final Modifier mod = ((ModifierQueryNode) node).getModifier(); if (mod == Modifier.MOD_REQ) { this.hasUnaryReqOperator = true; } } return node; }
if (modNode.getModifier() == Modifier.MOD_REQ) { return modNode.getChild(); if (modNode.getModifier() == Modifier.MOD_NONE) { return new BooleanModifierNode(modNode.getChild(), Modifier.MOD_REQ); if (modNode.getModifier() == Modifier.MOD_NONE) { return new BooleanModifierNode(modNode.getChild(), Modifier.MOD_REQ);
@Override public CharSequence toQueryString(EscapeQuerySyntax escapeSyntaxParser) { if (getChild() == null) return ""; String leftParenthensis = ""; String rightParenthensis = ""; if (getChild() != null && getChild() instanceof ModifierQueryNode) { leftParenthensis = "("; rightParenthensis = ")"; } if (getChild() instanceof BooleanQueryNode) { return this.modifier.toLargeString() + leftParenthensis + getChild().toQueryString(escapeSyntaxParser) + rightParenthensis; } else { return this.modifier.toDigitString() + leftParenthensis + getChild().toQueryString(escapeSyntaxParser) + rightParenthensis; } }
@Override protected ModifierQueryNode newClauseQueryNode(final QueryNode query, final Modifier mod) { return new ModifierQueryNode(query, mod); }
/** * Used to store the modifier value on the original query string * * @param query * - QueryNode subtree * @param mod * - Modifier Value */ public ModifierQueryNode(QueryNode query, Modifier mod) { if (query == null) { throw new QueryNodeError(new MessageImpl( QueryParserMessages.PARAMETER_VALUE_NOT_SUPPORTED, "query", "null")); } allocate(); setLeaf(false); add(query); this.modifier = mod; }
@Override protected QueryNode preProcessNode(final QueryNode node) throws QueryNodeException { if (node instanceof ModifierQueryNode) { final Modifier mod = ((ModifierQueryNode) node).getModifier(); if (mod == Modifier.MOD_REQ) { this.hasUnaryReqOperator = true; } } return node; }
if (modNode.getModifier() == Modifier.MOD_REQ) { return modNode.getChild(); if (node instanceof ModifierQueryNode) { final ModifierQueryNode modNode = (ModifierQueryNode) node; if (modNode.getModifier() == Modifier.MOD_NONE) { return new BooleanModifierNode(modNode.getChild(), Modifier.MOD_REQ); if (modNode.getModifier() == Modifier.MOD_NONE) { return new BooleanModifierNode(modNode.getChild(), Modifier.MOD_REQ);
@Override public CharSequence toQueryString(EscapeQuerySyntax escapeSyntaxParser) { if (getChild() == null) return ""; String leftParenthensis = ""; String rightParenthensis = ""; if (getChild() != null && getChild() instanceof ModifierQueryNode) { leftParenthensis = "("; rightParenthensis = ")"; } if (getChild() instanceof BooleanQueryNode) { return this.modifier.toLargeString() + leftParenthensis + getChild().toQueryString(escapeSyntaxParser) + rightParenthensis; } else { return this.modifier.toDigitString() + leftParenthensis + getChild().toQueryString(escapeSyntaxParser) + rightParenthensis; } }
final public QueryNode ModClause(CharSequence field) throws ParseException { QueryNode q; ModifierQueryNode.Modifier mods; mods = Modifiers(); q = Clause(field); if (mods != ModifierQueryNode.Modifier.MOD_NONE) { q = new ModifierQueryNode(q, mods); } {if (true) return q;} throw new Error("Missing return statement in function"); }
/** * Used to store the modifier value on the original query string * * @param query * - QueryNode subtree * @param mod * - Modifier Value */ public ModifierQueryNode(QueryNode query, Modifier mod) { if (query == null) { throw new QueryNodeError(new MessageImpl( QueryParserMessages.PARAMETER_VALUE_NOT_SUPPORTED, "query", "null")); } allocate(); setLeaf(false); add(query); this.modifier = mod; }
private QueryNode applyModifier(QueryNode node, ModifierQueryNode.Modifier mod) { // check if modifier is not already defined and is default if (!(node instanceof ModifierQueryNode)) { return new ModifierQueryNode(node, mod); } else { ModifierQueryNode modNode = (ModifierQueryNode) node; if (modNode.getModifier() == ModifierQueryNode.Modifier.MOD_NONE) { return new ModifierQueryNode(modNode.getChild(), mod); } } return node; }
private static BooleanClause.Occur getModifierValue(QueryNode node) { if (node instanceof ModifierQueryNode) { ModifierQueryNode mNode = ((ModifierQueryNode) node); switch (mNode.getModifier()) { case MOD_REQ: return BooleanClause.Occur.MUST; case MOD_NOT: return BooleanClause.Occur.MUST_NOT; case MOD_NONE: return BooleanClause.Occur.SHOULD; } } return BooleanClause.Occur.SHOULD; }
if (modNode.getModifier() == Modifier.MOD_REQ) { return modNode.getChild(); if (modNode.getModifier() == Modifier.MOD_NONE) { return new BooleanModifierNode(modNode.getChild(), Modifier.MOD_REQ); if (modNode.getModifier() == Modifier.MOD_NONE) { return new BooleanModifierNode(modNode.getChild(), Modifier.MOD_REQ);
public Query build(QueryNode queryNode) throws QueryNodeException { ModifierQueryNode modifierNode = (ModifierQueryNode) queryNode; return (Query) (modifierNode).getChild().getTag( QueryTreeBuilder.QUERY_TREE_BUILDER_TAGID); }
final public QueryNode ModClause(CharSequence field) throws ParseException { QueryNode q; ModifierQueryNode.Modifier mods; mods = Modifiers(); q = Clause(field); if (mods != ModifierQueryNode.Modifier.MOD_NONE) { q = new ModifierQueryNode(q, mods); } {if (true) return q;} throw new Error("Missing return statement in function"); }
public void setChild(QueryNode child) { List<QueryNode> list = new ArrayList<>(); list.add(child); this.set(list); }
public QueryNode getChild() { return getChildren().get(0); }