Top Description Fields Constructors Methods
org.eclipse.persistence.jpa.jpql.tools.model.query

public Class StringLiteralStateObject

extends SimpleStateObject
Class Inheritance
Imports
org.eclipse.persistence.jpa.jpql.ExpressionTools, org.eclipse.persistence.jpa.jpql.parser.StringLiteral

A string literal is enclosed in single quotes. For example: 'literal'. A string literal that includes a single quote is represented by two single quotes. For example: 'literal''s'. String literals in queries, like Java String literals, use unicode character encoding. Approximate literals support the use Java floating point literal syntax as well as SQL approximate numeric literal syntax. Enum literals support the use of Java enum literal syntax. The enum class name must be specified. Appropriate suffixes may be used to indicate the specific type of a numeric literal in accordance with the Java Language Specification. The boolean literals are TRUE and FALSE. Although predefined reserved literals appear in upper case, they are case insensitive.
Author
Pascal Filion
Since
2.4
Version
2.4
See Also
StringLiteral

Field Summary

Inherited from org.eclipse.persistence.jpa.jpql.tools.model.query.SimpleStateObject:
TEXT_PROPERTY

Constructor Summary

AccessConstructor and Description
public
StringLiteralStateObject(StateObject
The parent of this state object, which cannot be null
parent
)

Creates a new StringLiteralStateObject.

public
StringLiteralStateObject(StateObject
The parent of this state object, which cannot be null
parent
,
String
The string literal
literal
)

Creates a new StringLiteralStateObject.

Method Summary

Modifier and TypeMethod and Description
public void
public StringLiteral
getExpression()

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject.getExpression.

Implements org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.getExpression.

Returns the actual parsed object if this StateObject representation of the JPQL query was created by parsing an existing JPQL query.
public String

Returns:

The unquoted text
getUnquotedText
()

Returns the string literal without the single quotes.

public boolean

Returns:

true if the literal is ended by a single quote; false otherwise
hasCloseQuote
()

Determines whether the closing quote was present or not.

public void
setExpression(StringLiteral
The parsed object representing a string literal
expression
)

Keeps a reference of the parsed object object, which should only be done when this object is instantiated during the conversion of a parsed JPQL query into StateObjects.

Inherited from org.eclipse.persistence.jpa.jpql.tools.model.query.SimpleStateObject:
getTexthasTextisEquivalentsetTextsetTextInternallytoTextInternal

Constructor Detail

StringLiteralStateObjectback to summary
public StringLiteralStateObject(StateObject parent)

Creates a new StringLiteralStateObject.

Parameters
parent:StateObject

The parent of this state object, which cannot be null

Exceptions
NullPointerException:
The given parent cannot be null
StringLiteralStateObjectback to summary
public StringLiteralStateObject(StateObject parent, String literal)

Creates a new StringLiteralStateObject.

Parameters
parent:StateObject

The parent of this state object, which cannot be null

literal:String

The string literal

Exceptions
NullPointerException:
The given parent cannot be null

Method Detail

acceptback to summary
public void accept(StateObjectVisitor visitor)

Implements org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.accept.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.accept.

Visits this StateObject by the given visitor.

Parameters
visitor:StateObjectVisitor

The visitor to visit this object

Annotations
@Override
getExpressionback to summary
public StringLiteral getExpression()

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject.getExpression.

Implements org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.getExpression.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.getExpression.

Returns the actual parsed object if this StateObject representation of the JPQL query was created by parsing an existing JPQL query.

Returns:StringLiteral

The parsed object when a JPQL query is parsed and converted into a StateObject or null when the JPQL query is manually created (i.e. not from a string)

Annotations
@Override
getUnquotedTextback to summary
public String getUnquotedText()

Returns the string literal without the single quotes.

Returns:String

The unquoted text

hasCloseQuoteback to summary
public boolean hasCloseQuote()

Determines whether the closing quote was present or not.

Returns:boolean

true if the literal is ended by a single quote; false otherwise

setExpressionback to summary
public void setExpression(StringLiteral expression)

Keeps a reference of the parsed object object, which should only be done when this object is instantiated during the conversion of a parsed JPQL query into StateObjects.

Parameters
expression:StringLiteral

The parsed object representing a string literal