@InjectableComponent public final class DefaultJqlOperandResolver extends Object implements JqlOperandResolver
JqlOperandResolver
interface.Constructor and Description |
---|
DefaultJqlOperandResolver(JqlFunctionHandlerRegistry registry,
I18nHelper.BeanFactory factory,
QueryCache queryCache) |
Modifier and Type | Method and Description |
---|---|
QueryLiteral |
getSingleValue(ApplicationUser user,
Operand operand,
TerminalClause clause)
Returns the single value contained within the passed operand.
|
List<QueryLiteral> |
getValues(ApplicationUser searcher,
Operand operand,
TerminalClause terminalClause)
Return the values contained within the passed operand.
|
List<QueryLiteral> |
getValues(QueryCreationContext queryCreationContext,
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 funcOperand)
Sanitise a function operand for the specified user, so that information is not leaked.
|
MessageSet |
validate(ApplicationUser user,
Operand operand,
TerminalClause terminalClause)
Validates the operand against its handler.
|
MessageSet |
validate(ApplicationUser searcher,
Operand operand,
WasClause clause) |
public DefaultJqlOperandResolver(JqlFunctionHandlerRegistry registry, I18nHelper.BeanFactory factory, QueryCache queryCache)
public List<QueryLiteral> getValues(ApplicationUser searcher, Operand operand, TerminalClause terminalClause)
JqlOperandResolver
getValues
in interface JqlOperandResolver
searcher
- the user performing the searchoperand
- the operand whose values should be returned. Must not be null.terminalClause
- the terminal clause that contained the operandpublic List<QueryLiteral> getValues(QueryCreationContext queryCreationContext, Operand operand, TerminalClause terminalClause)
JqlOperandResolver
getValues
in interface JqlOperandResolver
queryCreationContext
- the context of query creationoperand
- the operand whose values should be returned. Must not be null.terminalClause
- the terminal clause that contained the operandpublic MessageSet validate(ApplicationUser user, Operand operand, TerminalClause terminalClause)
JqlOperandResolver
validate
in interface JqlOperandResolver
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 operandMessageSet
containing any errors reported. Note: if the operand is
unknown, an error message will be added to the message set returned. Never null.public MessageSet validate(ApplicationUser searcher, Operand operand, WasClause clause)
validate
in interface JqlOperandResolver
public FunctionOperand sanitiseFunctionOperand(ApplicationUser searcher, FunctionOperand funcOperand)
JqlOperandResolver
sanitiseFunctionOperand
in interface JqlOperandResolver
searcher
- the user performing the searchfuncOperand
- the operand to sanitise; will only be sanitised if validpublic QueryLiteral getSingleValue(ApplicationUser user, Operand operand, TerminalClause clause)
JqlOperandResolver
getSingleValue
in interface JqlOperandResolver
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 operandpublic boolean isEmptyOperand(Operand operand)
JqlOperandResolver
isEmptyOperand
in interface JqlOperandResolver
operand
- the operand to check if it is a EMPTY operandpublic boolean isFunctionOperand(Operand operand)
JqlOperandResolver
isFunctionOperand
in interface JqlOperandResolver
operand
- the operand to check. Cannot be null.public boolean isListOperand(Operand operand)
JqlOperandResolver
isListOperand
in interface JqlOperandResolver
operand
- the operand to check. Cannot be null.public boolean isValidOperand(Operand operand)
JqlOperandResolver
SingleValueOperand
s
MultiValueOperand
s
EmptyOperand
s
FunctionOperand
s registered as JqlFunction
s
isValidOperand
in interface JqlOperandResolver
operand
- the operand; cannot be null.Copyright © 2002-2021 Atlassian. All Rights Reserved.