Verified Owner
Top Description Fields Constructors Methods
org.jabref.logic.search.query

public Class GroupNameFilterVisitor

extends SearchBaseVisitor<Boolean>
Class Inheritance
Imports
java.util.Locale, org.jabref.logic.util.strings.StringUtil, org.jabref.model.search.query.SearchQuery, org.jabref.search.SearchBaseVisitor, .SearchParser, org.antlr.v4.runtime.misc.ParseCancellationException

Evaluates a Search.g4 parse tree against a group display name string. Key behavioral difference from SearchQueryVisitor: visitImplicitAndExpression uses OR semantics (anyMatch) instead of AND, so space-separated bare terms like "machine learning" match any group containing either word. Explicit AND/OR/NOT and parentheses work as expected.

Field Summary

Modifier and TypeField and Description
private final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static boolean
matches(String groupName, String query)

Implemented a static method that checks whether the group name matches the given query string.

public Boolean
public Boolean
public Boolean
public Boolean
public Boolean
public Boolean
public Boolean
Inherited from org.jabref.search.SearchBaseVisitor:
visitOperatorvisitSearchValue

Field Detail

groupNameback to summary
private final String groupName

Constructor Detail

GroupNameFilterVisitorback to summary
public GroupNameFilterVisitor(String groupName)

Method Detail

matchesback to summary
public static boolean matches(String groupName, String query)

Implemented a static method that checks whether the group name matches the given query string.

visitBinaryExpressionback to summary
public Boolean visitBinaryExpression(SearchParser.BinaryExpressionContext ctx)

Overrides org.jabref.search.SearchBaseVisitor.visitBinaryExpression.

Implements org.jabref.search.SearchVisitor.visitBinaryExpression.

Doc from org.jabref.search.SearchBaseVisitor.visitBinaryExpression.

Visit a parse tree produced by the binaryExpression labeled alternative in SearchParser#expression.

The default implementation returns the result of calling visitChildren on ctx.

Annotations
@Override
visitComparisonback to summary
public Boolean visitComparison(SearchParser.ComparisonContext ctx)

Overrides org.jabref.search.SearchBaseVisitor.visitComparison.

Implements org.jabref.search.SearchVisitor.visitComparison.

Doc from org.jabref.search.SearchBaseVisitor.visitComparison.

Visit a parse tree produced by SearchParser#comparison.

The default implementation returns the result of calling visitChildren on ctx.

Annotations
@Override
visitComparisonExpressionback to summary
public Boolean visitComparisonExpression(SearchParser.ComparisonExpressionContext ctx)

Overrides org.jabref.search.SearchBaseVisitor.visitComparisonExpression.

Implements org.jabref.search.SearchVisitor.visitComparisonExpression.

Doc from org.jabref.search.SearchBaseVisitor.visitComparisonExpression.

Visit a parse tree produced by the comparisonExpression labeled alternative in SearchParser#expression.

The default implementation returns the result of calling visitChildren on ctx.

Annotations
@Override
visitImplicitAndExpressionback to summary
public Boolean visitImplicitAndExpression(SearchParser.ImplicitAndExpressionContext ctx)

Overrides org.jabref.search.SearchBaseVisitor.visitImplicitAndExpression.

Implements org.jabref.search.SearchVisitor.visitImplicitAndExpression.

Doc from org.jabref.search.SearchBaseVisitor.visitImplicitAndExpression.

Visit a parse tree produced by the implicitAndExpression labeled alternative in SearchParser#andExpression.

The default implementation returns the result of calling visitChildren on ctx.

Annotations
@Override
visitNegatedExpressionback to summary
public Boolean visitNegatedExpression(SearchParser.NegatedExpressionContext ctx)

Overrides org.jabref.search.SearchBaseVisitor.visitNegatedExpression.

Implements org.jabref.search.SearchVisitor.visitNegatedExpression.

Doc from org.jabref.search.SearchBaseVisitor.visitNegatedExpression.

Visit a parse tree produced by the negatedExpression labeled alternative in SearchParser#expression.

The default implementation returns the result of calling visitChildren on ctx.

Annotations
@Override
visitParenExpressionback to summary
public Boolean visitParenExpression(SearchParser.ParenExpressionContext ctx)

Overrides org.jabref.search.SearchBaseVisitor.visitParenExpression.

Implements org.jabref.search.SearchVisitor.visitParenExpression.

Doc from org.jabref.search.SearchBaseVisitor.visitParenExpression.

Visit a parse tree produced by the parenExpression labeled alternative in SearchParser#expression.

The default implementation returns the result of calling visitChildren on ctx.

Annotations
@Override
visitStartback to summary
public Boolean visitStart(SearchParser.StartContext ctx)

Overrides org.jabref.search.SearchBaseVisitor.visitStart.

Implements org.jabref.search.SearchVisitor.visitStart.

Doc from org.jabref.search.SearchBaseVisitor.visitStart.

Visit a parse tree produced by SearchParser#start.

The default implementation returns the result of calling visitChildren on ctx.

Annotations
@Override