com.atlassian.jira.jql.clause
Class SingleParentVisitor

java.lang.Object
  extended by com.atlassian.jira.jql.clause.SingleParentVisitor
All Implemented Interfaces:
ClauseVisitor<java.lang.Boolean>

public class SingleParentVisitor
extends java.lang.Object
implements ClauseVisitor<java.lang.Boolean>

A visitor which searches the clause tree for the given clause names. If all the found clauses have the same parent, then the parent is returned with getSingleParent(), and the getFoundChildren() will return the found clauses. If the found claues have different parents, then getSingleParent() will return null and the getFoundChildren() will return an empty list. If the clause tree has only one clause as its root, which is being searched for, then getSingleParent() will return null and the getFoundChildren() will return a list with the root.

Since:
v4.0

Constructor Summary
SingleParentVisitor(java.util.Set<java.lang.String> clauseNames)
           
SingleParentVisitor(java.lang.String... clauseNames)
           
 
Method Summary
 java.util.List<TerminalClause> getFoundChildren()
           
 Clause getSingleParent()
           
 java.lang.Boolean visit(AndClause andClause)
          Visit called when accepting a AndClause.
 java.lang.Boolean visit(NotClause notClause)
          Visit called when accepting a NotClause.
 java.lang.Boolean visit(OrClause orClause)
          Visit called when accepting a OrClause.
 java.lang.Boolean visit(TerminalClause clause)
          Visit called when accepting a TerminalClause.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingleParentVisitor

public SingleParentVisitor(java.lang.String... clauseNames)

SingleParentVisitor

public SingleParentVisitor(java.util.Set<java.lang.String> clauseNames)
Method Detail

getSingleParent

public Clause getSingleParent()

getFoundChildren

public java.util.List<TerminalClause> getFoundChildren()

visit

public java.lang.Boolean visit(AndClause andClause)
Description copied from interface: ClauseVisitor
Visit called when accepting a AndClause.

Specified by:
visit in interface ClauseVisitor<java.lang.Boolean>
Parameters:
andClause - the node being visited.
Returns:
The return type specified by the visitor.

visit

public java.lang.Boolean visit(OrClause orClause)
Description copied from interface: ClauseVisitor
Visit called when accepting a OrClause.

Specified by:
visit in interface ClauseVisitor<java.lang.Boolean>
Parameters:
orClause - the node being visited.
Returns:
The return type specified by the visitor.

visit

public java.lang.Boolean visit(NotClause notClause)
Description copied from interface: ClauseVisitor
Visit called when accepting a NotClause.

Specified by:
visit in interface ClauseVisitor<java.lang.Boolean>
Parameters:
notClause - the node being visited.
Returns:
The return type specified by the visitor.

visit

public java.lang.Boolean visit(TerminalClause clause)
Description copied from interface: ClauseVisitor
Visit called when accepting a TerminalClause.

Specified by:
visit in interface ClauseVisitor<java.lang.Boolean>
Parameters:
clause - the node being visited.
Returns:
The return type specified by the visitor.


Copyright © 2002-2010 Atlassian. All Rights Reserved.