com.atlassian.jira.jql.context
Class MultiClauseDecoratorContextFactory

java.lang.Object
  extended by com.atlassian.jira.jql.context.MultiClauseDecoratorContextFactory
All Implemented Interfaces:
ClauseContextFactory

public class MultiClauseDecoratorContextFactory
extends java.lang.Object
implements ClauseContextFactory

Decorates a ClauseContextFactory to ensure that:

 context(k in (a, b, c)) <=> context(k = a or k = b or k = c)
 context(k not in (a, b, c)) <=> context(k != a and k != b and k != c)
 
It does this by intercepting calls to getClauseContext(com.opensymphony.user.User, com.atlassian.query.clause.TerminalClause) with a terminal clause that contains the Operator.IN or Operator.NOT_IN operator and converts it into equivalent multiple calls to the delegate factory.

Since:
v4.0

Nested Class Summary
static class MultiClauseDecoratorContextFactory.Factory
          Factory to create a MultiClauseDecoratorContextFactory given a ClauseContextFactory to wrap.
 
Constructor Summary
MultiClauseDecoratorContextFactory(JqlOperandResolver jqlOperandResolver, ClauseContextFactory delegate)
           
MultiClauseDecoratorContextFactory(JqlOperandResolver jqlOperandResolver, ClauseContextFactory delegate, ContextSetUtil contextSetUtil)
           
 
Method Summary
 ClauseContext getClauseContext(com.opensymphony.user.User searcher, TerminalClause terminalClause)
          Generates a clause context for the associated handler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiClauseDecoratorContextFactory

public MultiClauseDecoratorContextFactory(JqlOperandResolver jqlOperandResolver,
                                          ClauseContextFactory delegate)

MultiClauseDecoratorContextFactory

public MultiClauseDecoratorContextFactory(JqlOperandResolver jqlOperandResolver,
                                          ClauseContextFactory delegate,
                                          ContextSetUtil contextSetUtil)
Method Detail

getClauseContext

public final ClauseContext getClauseContext(com.opensymphony.user.User searcher,
                                            TerminalClause terminalClause)
Description copied from interface: ClauseContextFactory
Generates a clause context for the associated handler. If the clause context could not be determined for any reason, this will return the Global Clause Context.

Specified by:
getClauseContext in interface ClauseContextFactory
Parameters:
searcher - the user who is performing the search
terminalClause - the clause for which this factory is generating a context.
Returns:
ClauseContext that contains the implied and explicit project and issue types that this clause is in context for.


Copyright © 2002-2010 Atlassian. All Rights Reserved.