|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.jql.util.JqlStringSupportImpl
public final class JqlStringSupportImpl
Some utility code to help with JQL strings.
The JQL grammar depends on the implementationisReservedString(java.lang.String)
method from this class. The other methods
depend upon the definitions within the JQL grammar (Jql.g). Changing the grammar will likely require changing this
class.
Field Summary | |
---|---|
static Set<String> |
RESERVED_WORDS
|
Constructor Summary | |
---|---|
JqlStringSupportImpl(JqlQueryParser parser)
|
Method Summary | |
---|---|
static String |
decode(String string)
Remove escaping JQL escaping from the passed string. |
static String |
encodeAsQuotedString(String string)
Encode the passed string into a valid JQL encoded quoted string. |
static String |
encodeAsQuotedString(String string,
boolean escapeNewline)
Encode the passed string into a valid JQL encoded quoted string. |
static String |
encodeCharacter(char character)
Encode the passed character so that it may be used in JQL. |
static String |
encodeCharacterForce(char character)
Escape the passed character so that it may be used in JQL. |
String |
encodeFieldName(String fieldName)
Encode the passed string into a safe JQL field name. |
String |
encodeFunctionArgument(String argument)
Encode the passed string into a safe JQL function argument. |
String |
encodeFunctionName(String functionName)
Encode the passed string into a safe JQL function name. |
String |
encodeStringValue(String value)
Encode the passed string value into a safe JQL value if necessary. |
String |
encodeValue(String value)
Encode the passed string value into a safe JQL value if necessary. |
String |
generateJqlString(Clause clause)
Generates a JQL string representation for the passed clause. |
String |
generateJqlString(Query query)
Generates a JQL string representation for the passed query. |
Set<String> |
getJqlReservedWords()
|
static boolean |
isJqlControl(char c)
Tells if caller if the passed character is considered a control character by JQL. |
static boolean |
isReservedString(String string)
Tell the caller if the passed string is a reserved JQL string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Set<String> RESERVED_WORDS
Constructor Detail |
---|
public JqlStringSupportImpl(JqlQueryParser parser)
Method Detail |
---|
public Set<String> getJqlReservedWords()
getJqlReservedWords
in interface JqlStringSupport
public String encodeStringValue(String value)
JqlStringSupport
encodeStringValue
in interface JqlStringSupport
value
- the value to encode.
public String encodeValue(String value)
JqlStringSupport
JqlStringSupport.encodeStringValue(String)
since it will not add quotes around
long values.
encodeValue
in interface JqlStringSupport
value
- the value to encode.
public String encodeFunctionArgument(String argument)
JqlStringSupport
encodeFunctionArgument
in interface JqlStringSupport
argument
- the string to encode.
public String encodeFunctionName(String functionName)
JqlStringSupport
encodeFunctionName
in interface JqlStringSupport
functionName
- the string to encode.
public String encodeFieldName(String fieldName)
JqlStringSupport
encodeFieldName
in interface JqlStringSupport
fieldName
- the string to encode.
public String generateJqlString(Query query)
JqlStringSupport
Query.getQueryString()
is completely ignored if it exists. The returned JQL is automatically escaped as necessary.
generateJqlString
in interface JqlStringSupport
query
- the query. Cannot be null.
public String generateJqlString(Clause clause)
JqlStringSupport
generateJqlString
in interface JqlStringSupport
clause
- the clause. Cannot be null.
public static String decode(String string) throws IllegalArgumentException
string
- the string to decode.
IllegalArgumentException
- if the input string contains invalid escape sequences.public static String encodeAsQuotedString(String string)
string
- the string to encode.
public static String encodeAsQuotedString(String string, boolean escapeNewline)
string
- the string to encode.escapeNewline
- should escape and newline characters be escaped.
public static String encodeCharacterForce(char character)
character
- the character to escape.
public static String encodeCharacter(char character)
character
- the character to encode.
public static boolean isReservedString(String string)
string
- the word to test.
public static boolean isJqlControl(char c)
c
- the character to check.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |