@PublicSpi public abstract class

AbstractJqlFunction

extends Object
implements JqlFunction
java.lang.Object
   ↳ com.atlassian.jira.plugin.jql.function.AbstractJqlFunction
Known Direct Subclasses
Known Indirect Subclasses

@PublicSpi

This class is designed for plugins to implement.

Clients of @PublicSpi can expect that programs compiled against a given version will remain binary compatible with later versions of the @PublicSpi as per each product's API policy (clients should refer to each product's API policy for the exact guarantee -- usually binary compatibility is guaranteed at least across minor versions).

Note: @PublicSpi interfaces and classes are specifically designed to be implemented/extended by clients. Hence, the guarantee of binary compatibility is different to that of @PublicApi elements (if an element is both @PublicApi and @PublicSpi, both guarantees apply).

Class Overview

A useful base implementation of the JqlFunction interface, that provides sensible default behaviour for the init(JqlFunctionModuleDescriptor), getFunctionName() and isList() methods. You should not need to override these methods in your implementation.

See Also

Summary

Public Constructors
AbstractJqlFunction()
Public Methods
String getFunctionName()
The name of the function.
JqlFunctionModuleDescriptor getModuleDescriptor()
void init(JqlFunctionModuleDescriptor moduleDescriptor)
Initialises this pluggable function with it's module descriptor.
boolean isList()
This method should return true if the function is meant to be used with the IN or NOT IN operators, that is, if the function should be viewed as returning a list.
Protected Methods
I18nHelper getI18n()
MessageSet validateNumberOfArgs(FunctionOperand operand, int expected)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.plugin.jql.function.JqlFunction

Public Constructors

public AbstractJqlFunction ()

Public Methods

public String getFunctionName ()

The name of the function. Multiple calls to this method must return the same result. This means that the function name cannot be internationalised with respect to the searcher.

Returns
  • the name of the function. Cannot be null.

public JqlFunctionModuleDescriptor getModuleDescriptor ()

public void init (JqlFunctionModuleDescriptor moduleDescriptor)

Initialises this pluggable function with it's module descriptor.

Parameters
moduleDescriptor the module descriptor; will not be null.

public boolean isList ()

This method should return true if the function is meant to be used with the IN or NOT IN operators, that is, if the function should be viewed as returning a list. The method should return false when it is to be used with the other relational operators (e.g. =, !=, <, >, ...) that only work with single values.

As a general rule, if a function is going to return more than one value then it should return true here, otherwise it should return false. This does not necessarily need to be the case. For example, it is possible for function that returns false here to return more than one value when it is run.

Returns
  • true if the function can should be considered a list (i.e. work with IN and NOT IN), or false otherwise. In this case it is considered to return a single value (i.e. work with =, !=, <, >, ...).

Protected Methods

protected I18nHelper getI18n ()

protected MessageSet validateNumberOfArgs (FunctionOperand operand, int expected)