public interface

JqlOperandResolver

com.atlassian.jira.jql.operand.JqlOperandResolver
Known Indirect Subclasses

Class Overview

Responsible for validating Operands and extracting the QueryLiteral values from them.

Summary

Public Methods
QueryLiteral getSingleValue(ApplicationUser user, Operand operand, TerminalClause clause)
Returns the single value contained within the passed operand.
List<QueryLiteral> getValues(QueryCreationContext queryCreationContext, Operand operand, TerminalClause terminalClause)
Return the values contained within the passed operand.
List<QueryLiteral> getValues(ApplicationUser searcher, Operand operand, TerminalClause terminalClause)
Return the values contained within the passed operand.
boolean isEmptyOperand(Operand operand)
Returns true if the operand represents an EMPTY operand.
boolean isFunctionOperand(Operand operand)
Returns true if the passed operand is a function call.
boolean isListOperand(Operand operand)
Returns true if the passed operand returns a list of values.
boolean isValidOperand(Operand operand)
Returns true if the operand is one which is known about.
FunctionOperand sanitiseFunctionOperand(ApplicationUser searcher, FunctionOperand operand)
Sanitise a function operand for the specified user, so that information is not leaked.
MessageSet validate(ApplicationUser searcher, Operand operand, WasClause clause)
MessageSet validate(ApplicationUser user, Operand operand, TerminalClause terminalClause)
Validates the operand against its handler.

Public Methods

public QueryLiteral getSingleValue (ApplicationUser user, Operand operand, TerminalClause clause)

Returns the single value contained within the passed operand. If the operand contains more than one value, an exception is thrown.

Parameters
user the user who is retrieving the values. May be null.
operand the operand whose values should be returned. Must not be null.
clause the terminal clause that contained the operand
Returns
  • the single value present in the operand, or null if there is no value.
Throws
IllegalArgumentException if the operand contains more than one value.

public List<QueryLiteral> getValues (QueryCreationContext queryCreationContext, Operand operand, TerminalClause terminalClause)

Return the values contained within the passed operand.

Parameters
queryCreationContext the context of query creation
operand the operand whose values should be returned. Must not be null.
terminalClause the terminal clause that contained the operand
Returns
  • a list of the values in the literal. May return null on an error.

public List<QueryLiteral> getValues (ApplicationUser searcher, Operand operand, TerminalClause terminalClause)

Return the values contained within the passed operand.

Parameters
searcher the user performing the search
operand the operand whose values should be returned. Must not be null.
terminalClause the terminal clause that contained the operand
Returns
  • a list of the values in the literal. May return null on an error.

public boolean isEmptyOperand (Operand operand)

Returns true if the operand represents an EMPTY operand.

Parameters
operand the operand to check if it is a EMPTY operand
Returns
  • true if the operand is an EMPTY operand, false otherwise.

public boolean isFunctionOperand (Operand operand)

Returns true if the passed operand is a function call.

Parameters
operand the operand to check. Cannot be null.
Returns
  • true of the passed operand is a function operand, false otherwise.

public boolean isListOperand (Operand operand)

Returns true if the passed operand returns a list of values.

Parameters
operand the operand to check. Cannot be null.
Returns
  • true if the passed operand returns a list of values or false otherwise.

public boolean isValidOperand (Operand operand)

Returns true if the operand is one which is known about. This is:

Parameters
operand the operand; cannot be null.
Returns
  • true if it is known, false otherwise.

public FunctionOperand sanitiseFunctionOperand (ApplicationUser searcher, FunctionOperand operand)

Sanitise a function operand for the specified user, so that information is not leaked.

Parameters
searcher the user performing the search
operand the operand to sanitise; will only be sanitised if valid
Returns
  • the sanitised operand; never null.

public MessageSet validate (ApplicationUser searcher, Operand operand, WasClause clause)

public MessageSet validate (ApplicationUser user, Operand operand, TerminalClause terminalClause)

Validates the operand against its handler.

Parameters
user the user who is validating. May be null.
operand the operand to be validated. Must not be null.
terminalClause the terminal clause that contained the operand
Returns
  • a MessageSet containing any errors reported. Note: if the operand is unknown, an error message will be added to the message set returned. Never null.