java.lang.Object | |
↳ | com.atlassian.jira.jql.util.JqlStringSupportImpl |
Some utility code to help with JQL strings.
The JQL grammar depends on the implementation isReservedString(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.
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
RESERVED_WORDS |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Remove escaping JQL escaping from the passed string.
| |||||||||||
Encode the passed string into a valid JQL encoded quoted string.
| |||||||||||
Encode the passed string into a valid JQL encoded quoted string.
| |||||||||||
Encode the passed character so that it may be used in JQL.
| |||||||||||
Escape the passed character so that it may be used in JQL.
| |||||||||||
Encode the passed string into a safe JQL field name.
| |||||||||||
Encode the passed string into a safe JQL function argument.
| |||||||||||
Encode the passed string into a safe JQL function name.
| |||||||||||
Encode the passed string value into a safe JQL value if necessary.
| |||||||||||
Encode the passed string value into a safe JQL value if necessary.
| |||||||||||
Generates a JQL string representation for the passed clause.
| |||||||||||
Generates a JQL string representation for the passed query.
| |||||||||||
Tells if caller if the passed character is considered a control character by JQL.
| |||||||||||
Tell the caller if the passed string is a reserved JQL string.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
com.atlassian.jira.jql.util.JqlStringSupport
|
Remove escaping JQL escaping from the passed string.
string | the string to decode. |
---|
IllegalArgumentException | if the input string contains invalid escape sequences. |
---|
Encode the passed string into a valid JQL encoded quoted string. A JQL string can represent newline (\n) and carriage return (\r) in two different ways: Its raw value or its escaped value. The passed boolean flag can be used to control which representation is used.
string | the string to encode. |
---|---|
escapeNewline | should escape and newline characters be escaped. |
Encode the passed string into a valid JQL encoded quoted string.
string | the string to encode. |
---|
Encode the passed character so that it may be used in JQL. null will be returned if the character does not need to be encoded.
character | the character to encode. |
---|
Escape the passed character so that it may be used in JQL. The character is escaped even if it does not need to be.
character | the character to escape. |
---|
Encode the passed string into a safe JQL field name. This value will not be encoded if it is not already safe.
fieldName | the string to encode. |
---|
Encode the passed string into a safe JQL function argument. The value will not be encoded if it is already safe.
argument | the string to encode. |
---|
Encode the passed string into a safe JQL function name. This value will not be encoded if it is not already safe.
functionName | the string to encode. |
---|
Encode the passed string value into a safe JQL value if necessary. The value will not be encoded if it is already safe.
value | the value to encode. |
---|
Encode the passed string value into a safe JQL value if necessary. The value will not be encoded if it is
already safe. This is different to encodeStringValue(String)
since it will not add quotes around
long values.
value | the value to encode. |
---|
Generates a JQL string representation for the passed clause. The returned JQL is automatically escaped as necessary.
clause | the clause. Cannot be null. |
---|
Generates a JQL string representation for the passed query. The JQL string is always generated, that is, getQueryString()
is completely ignored if it exists. The returned JQL is automatically escaped as necessary.
query | the query. Cannot be null. |
---|
Tells if caller if the passed character is considered a control character by JQL.
NOTE: This method duplicates some logic from the grammar. If the grammar changes then this method will also need to change. We have replicated the logic for effeciency reasons.
c | the character to check. |
---|
Tell the caller if the passed string is a reserved JQL string. We do this in here rather than the grammar because ANTLR does not deal well (generates a huge and very slow lexer) when matching lots of different tokens. In fact, the ANTLR grammar calls this method internally to see if a JQL string is reserved.
string | the word to test. |
---|