TRIM function trims the specified character from a string. If the
character to be trimmed is not specified, it is assumed to be space (or blank). The optional
trim_character is a single-character string literal or a character-valued input
parameter (i.e., char or Character). If a trim specification is not provided,
BOTH is assumed. The TRIM function returns the trimmed
string.
BNF: expression ::= TRIM([[trim_specification] [trim_character] FROM] string_primary)
TrimExpression
| Modifier and Type | Field and Description |
|---|---|
| public static final String | HAS_FROM_PROPERTY
Notifies the visibility of the |
| private TrimExpression. | specification
Defines the way the string is trimmed. |
| public static final String | SPECIFICATION_PROPERTY
Notifies the specification property has changed. |
| public static final String | TRIM_CHARACTER_PROPERTY
Notify the state object representing the trim character has changed. |
| private StateObject | trimCharacter
The trim character, if specified. |
| Access | Constructor and Description |
|---|---|
| public | TrimExpressionStateObject(StateObject
The parent of this state object, which cannot be parent)nullCreates a new |
| public | TrimExpressionStateObject(StateObject
The parent of this state object, which cannot be parent, TrimExpression.nullDefines the way the string is trimmed, or specification,Specification. when it is not presentThe stateObject)StateObject representing the encapsulated expressionCreates a new |
| public | TrimExpressionStateObject(StateObject
The parent of this state object, which cannot be parent, TrimExpression.nullDefines the way the string is trimmed, or specification,Specification. when it is not presentThe trim character trimCharacter, StateObject The stateObject)StateObject representing the encapsulated expressionCreates a new |
| public | TrimExpressionStateObject(StateObject
The parent of this state object, which cannot be parent, String nullThe portion of the query representing the encapsulated expression jpqlFragment)Creates a new |
| Modifier and Type | Method and Description |
|---|---|
| public void | accept(StateObjectVisitor
The visitor)visitor to visit this objectImplements org. StateObject by the given visitor.
|
| public TrimExpression | getExpression()
Implements org. StateObject representation of the JPQL query
was created by parsing an existing JPQL query.
|
| public String | getIdentifier()
Implements abstract org. AbstractSingleEncapsulatedExpressionStateObject.
|
| protected String | getQueryBNFId()
Implements abstract org. JPQLQueryBNF that will determine how to parse the encapsulated expression.
|
| public TrimExpression. | Returns: The new trim specification; which is nevernullReturns the new trim specification. |
| public StateObject | |
| public boolean | Returns: true if the query contained the way the trim needs to be trimmed;
false otherwiseDetermines whether the way the trim is trimmed was parsed. |
| public boolean | Returns: true if the character used for trimming was specified; false
otherwiseDetermines whether the character used to trim the string was specified. |
| public boolean | isEquivalent(StateObject
The stateObject)
StateObject to compare its content to this oneImplements org. StateObject is equivalent to this one, i.e. the
information of both StateObject is the same.
|
| public void | parse(String
The portion of the query representing the encapsulated expression jpqlFragment)
Parses the given JPQL fragment, which represents the encapsulated expression, and creates the
StateObject.
|
| public void | parseTrimCharacter(CharSequence
The portion of the query to parse jpqlFragment)Parses the given JPQL fragment, which represents either a single-character string literal or a
character-valued input parameter, the fragment will be parsed and converted into a |
| public void | |
| public void | |
| public void | setExpression(TrimExpression
The expression)parsed object representing a TRIM
expressionKeeps a reference of the |
| public void | setSpecification(TrimExpression.
The new trim specification; specificationnull is not validSets the new trim specification. |
| public void | setStateObject(StateObject
The new encapsulated stateObject)
Sets the given StateObjectStateObject to represent the new encapsulated expression.
|
| public void | setTrimCharacter(StateObject
The trim character or trimCharacter)null to remove itSets the character to trim from the string. |
| protected void | toTextEncapsulatedExpression(Appendable
The writer used to print out the string representation of the encapsulated
information writer)
Prints out a string representation of this encapsulated information, which should not be used
to define a true string representation of a JPQL query but should be used for
debugging purposes.
|
| HAS_FROM_PROPERTY | back to summary |
|---|---|
| public static final String HAS_FROM_PROPERTY Notifies the visibility of the | |
| specification | back to summary |
|---|---|
| private TrimExpression. Defines the way the string is trimmed. | |
| SPECIFICATION_PROPERTY | back to summary |
|---|---|
| public static final String SPECIFICATION_PROPERTY Notifies the specification property has changed. | |
| TRIM_CHARACTER_PROPERTY | back to summary |
|---|---|
| public static final String TRIM_CHARACTER_PROPERTY Notify the state object representing the trim character has changed. | |
| trimCharacter | back to summary |
|---|---|
| private StateObject trimCharacter The trim character, if specified. | |
| TrimExpressionStateObject | back to summary |
|---|---|
| public TrimExpressionStateObject(StateObject parent) Creates a new
| |
| TrimExpressionStateObject | back to summary |
|---|---|
| public TrimExpressionStateObject(StateObject parent, TrimExpression. Creates a new
| |
| TrimExpressionStateObject | back to summary |
|---|---|
| public TrimExpressionStateObject(StateObject parent, TrimExpression. Creates a new
| |
| TrimExpressionStateObject | back to summary |
|---|---|
| public TrimExpressionStateObject(StateObject parent, String jpqlFragment) Creates a new
| |
| accept | back to summary |
|---|---|
| public void accept(StateObjectVisitor visitor) Implements org. Doc from org. Visits this
| |
| getExpression | back to summary |
|---|---|
| public TrimExpression getExpression() Implements org. Doc from org. Returns the actual parsed object if this
| |
| getIdentifier | back to summary |
|---|---|
| public String getIdentifier() Implements abstract org. Returns the JPQL identifier of the expression represented by this | |
| getQueryBNFId | back to summary |
|---|---|
| protected String getQueryBNFId() Implements abstract org. Returns the unique identifier of the | |
| getSpecification | back to summary |
|---|---|
| public TrimExpression. Returns the new trim specification.
| |
| getTrimCharacter | back to summary |
|---|---|
| public StateObject getTrimCharacter() Returns the
| |
| hasSpecification | back to summary |
|---|---|
| public boolean hasSpecification() Determines whether the way the trim is trimmed was parsed.
| |
| hasTrimCharacter | back to summary |
|---|---|
| public boolean hasTrimCharacter() Determines whether the character used to trim the string was specified.
| |
| isEquivalent | back to summary |
|---|---|
| public boolean isEquivalent(StateObject stateObject) Implements org. Doc from org. Determines whether the given
| |
| parse | back to summary |
|---|---|
| public void parse(String jpqlFragment) Parses the given JPQL fragment, which represents the encapsulated expression, and creates the
| |
| parseTrimCharacter | back to summary |
|---|---|
| public void parseTrimCharacter(CharSequence jpqlFragment) Parses the given JPQL fragment, which represents either a single-character string literal or a
character-valued input parameter, the fragment will be parsed and converted into a
| |
| removeSpecification | back to summary |
|---|---|
| public void removeSpecification() Removes the trim specification. | |
| removeTrimCharacter | back to summary |
|---|---|
| public void removeTrimCharacter() Removes the trim character if it is defined. | |
| setExpression | back to summary |
|---|---|
| public void setExpression(TrimExpression expression) Keeps a reference of the
| |
| setSpecification | back to summary |
|---|---|
| public void setSpecification(TrimExpression. Sets the new trim specification.
| |
| setStateObject | back to summary |
|---|---|
| public void setStateObject(StateObject stateObject) Sets the given
| |
| setTrimCharacter | back to summary |
|---|---|
| public void setTrimCharacter(StateObject trimCharacter) Sets the character to trim from the string. If the character to be trimmed is not specified,
it is assumed to be space (or blank). It is a single-character string literal or a character-
valued input parameter (i.e., char or
| |
| toTextEncapsulatedExpression | back to summary |
|---|---|
| protected void toTextEncapsulatedExpression(Appendable writer) throws IOException Prints out a string representation of this encapsulated information, which should not be used
to define a
| |