com.atlassian.jira.jql.parser
Class DefaultJqlQueryParser

java.lang.Object
  extended by com.atlassian.jira.jql.parser.DefaultJqlQueryParser
All Implemented Interfaces:
JqlQueryParser

@ThreadSafe
public final class DefaultJqlQueryParser
extends Object
implements JqlQueryParser

An implementation of JqlQueryParser that implements the query parser using ANTLR.

Since:
v4.0

Constructor Summary
DefaultJqlQueryParser()
           
 
Method Summary
 boolean isValidFieldName(String fieldName)
          Determines whether or not the passed string is a valid JQL field name.
 boolean isValidFunctionArgument(String argument)
          Determines whether or not the passed string is a valid JQL function argument.
 boolean isValidFunctionName(String functionName)
          Determines whether or not the passed string is a valid JQL function name.
 boolean isValidValue(String value)
          Determines whether or not the passed string is a valid JQL value.
static void main(String[] args)
           
 Query parseQuery(String jqlQuery)
          Parse the passed JQL string into its SearchQuery representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultJqlQueryParser

public DefaultJqlQueryParser()
Method Detail

parseQuery

public final Query parseQuery(String jqlQuery)
                       throws JqlParseException
Description copied from interface: JqlQueryParser
Parse the passed JQL string into its SearchQuery representation.

Specified by:
parseQuery in interface JqlQueryParser
Parameters:
jqlQuery - the JQL string to parse. Must not be null or blank.
Returns:
the Query representation of the passed jql string. Never null.
Throws:
JqlParseException - if an error occurs while parsing the query.

isValidFieldName

public boolean isValidFieldName(String fieldName)
Description copied from interface: JqlQueryParser
Determines whether or not the passed string is a valid JQL field name.

Specified by:
isValidFieldName in interface JqlQueryParser
Parameters:
fieldName - the field name to check.
Returns:
true if the passed string is a valid field name or false otherwise.

isValidFunctionArgument

public boolean isValidFunctionArgument(String argument)
Description copied from interface: JqlQueryParser
Determines whether or not the passed string is a valid JQL function argument.

Specified by:
isValidFunctionArgument in interface JqlQueryParser
Parameters:
argument - the function argument to check.
Returns:
true if the passed function argument is valid or false otherwise.

isValidFunctionName

public boolean isValidFunctionName(String functionName)
Description copied from interface: JqlQueryParser
Determines whether or not the passed string is a valid JQL function name.

Specified by:
isValidFunctionName in interface JqlQueryParser
Parameters:
functionName - the function name to check.
Returns:
true if the passed function name is valid or false otherwise.

isValidValue

public boolean isValidValue(String value)
Description copied from interface: JqlQueryParser
Determines whether or not the passed string is a valid JQL value.

Specified by:
isValidValue in interface JqlQueryParser
Parameters:
value - the value to check.
Returns:
true if the passed value is valid or false otherwise.

main

public static void main(String[] args)
                 throws IOException
Throws:
IOException


Copyright © 2002-2013 Atlassian. All Rights Reserved.