com.atlassian.jira.plugin.jql.function
Class AbstractJqlFunction

java.lang.Object
  extended by com.atlassian.jira.plugin.jql.function.AbstractJqlFunction
All Implemented Interfaces:
JqlFunction
Direct Known Subclasses:
AbstractIssueTypeFunction, AbstractVersionsFunction, CascadeOptionFunction, CurrentUserFunction, EchoFunction, IssueHistoryFunction, LinkedIssuesFunction, MembersOfFunction, NowFunction, VotedIssuesFunction, WatchedIssuesFunction

public abstract class AbstractJqlFunction
extends Object
implements JqlFunction

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.

Since:
4.0
See Also:
JqlFunction

Constructor Summary
AbstractJqlFunction()
           
 
Method Summary
 String getFunctionName()
           
protected  I18nHelper getI18n()
           
 JqlFunctionModuleDescriptor getModuleDescriptor()
           
 void init(JqlFunctionModuleDescriptor moduleDescriptor)
          Initialises this pluggable function with it's module descriptor.
 boolean isList()
          Note: this method should only return false if it will NEVER return more than a single value; if it sometimes returns a single value, but sometimes returns multiple values, the return value of this function should always be true.
protected  MessageSet validateNumberOfArgs(FunctionOperand operand, int expected)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.jira.plugin.jql.function.JqlFunction
getDataType, getMinimumNumberOfExpectedArguments, getValues, validate
 

Constructor Detail

AbstractJqlFunction

public AbstractJqlFunction()
Method Detail

init

public void init(JqlFunctionModuleDescriptor moduleDescriptor)
Description copied from interface: JqlFunction
Initialises this pluggable function with it's module descriptor.

Specified by:
init in interface JqlFunction
Parameters:
moduleDescriptor - the module descriptor; must not be null.

getModuleDescriptor

public JqlFunctionModuleDescriptor getModuleDescriptor()

validateNumberOfArgs

protected MessageSet validateNumberOfArgs(FunctionOperand operand,
                                          int expected)

getFunctionName

public String getFunctionName()
Specified by:
getFunctionName in interface JqlFunction
Returns:
the name of the function

isList

public boolean isList()
Description copied from interface: JqlFunction
Note: this method should only return false if it will NEVER return more than a single value; if it sometimes returns a single value, but sometimes returns multiple values, the return value of this function should always be true.

Specified by:
isList in interface JqlFunction
Returns:
true if the function can return a list of values; false if it only ever returns a single value.

getI18n

protected I18nHelper getI18n()


Copyright © 2002-2009 Atlassian. All Rights Reserved.