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

public Class SubExpressionStateObject

extends AbstractSingleEncapsulatedExpressionStateObject
Class Inheritance
Annotations
@SuppressWarnings:nls
Imports
org.eclipse.persistence.jpa.jpql.Assert, .ExpressionTools, org.eclipse.persistence.jpa.jpql.parser.SubExpression

This expression wraps a sub-expression within parenthesis.

BNF: expression ::= (sub_expression)

Author
Pascal Filion
Since
2.4
Version
2.4
See Also
SubExpression

Field Summary

Modifier and TypeField and Description
private String
queryBNFId

The unique identifier of the JPQLQueryBNF that is used to parse the encapsulated expression.

Inherited from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractSingleEncapsulatedExpressionStateObject:
STATE_OBJECT_PROPERTY

Constructor Summary

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

Creates a new SubExpressionStateObject.

public
SubExpressionStateObject(StateObject
The parent of this state object, which cannot be null
parent
,
StateObject
The StateObject representing the encapsulated expression
stateObject
)

Creates a new SubExpressionStateObject.

public
SubExpressionStateObject(StateObject
The parent of this state object, which cannot be null
parent
,
String
The portion of the query representing the encapsulated expression
jpqlFragment
,
String
The unique identifier of the .JPQLQueryBNF JPQLQueryBNF that is used to parse the encapsulated expression
queryBNFId
)

Creates a new SubExpressionStateObject.

Method Summary

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

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractSingleEncapsulatedExpressionStateObject.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
protected String
getQueryBNFId()

Implements abstract org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractSingleEncapsulatedExpressionStateObject.getQueryBNFId.

Returns the unique identifier of the JPQLQueryBNF that will determine how to parse the encapsulated expression.
public void
setExpression(SubExpression
The parsed object representing an encapsulated expression
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.

public void
setQueryBNFId(String
The non-null ID of the BNF
queryBNFId
)

Sets the unique identifier of the JPQLQueryBNF that is used to parse the encapsulated expression.

public void
setStateObject(StateObject
The new encapsulated StateObject
stateObject
)

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractSingleEncapsulatedExpressionStateObject.setStateObject.

Sets the given StateObject to represent the new encapsulated expression.
Inherited from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractSingleEncapsulatedExpressionStateObject:
addChildrengetStateObjecthasStateObjectisEquivalentparsetoTextEncapsulatedExpression

Field Detail

queryBNFIdback to summary
private String queryBNFId

The unique identifier of the JPQLQueryBNF that is used to parse the encapsulated expression.

Constructor Detail

SubExpressionStateObjectback to summary
public SubExpressionStateObject(StateObject parent)

Creates a new SubExpressionStateObject.

Parameters
parent:StateObject

The parent of this state object, which cannot be null

Exceptions
NullPointerException:
The given parent cannot be null
SubExpressionStateObjectback to summary
public SubExpressionStateObject(StateObject parent, StateObject stateObject)

Creates a new SubExpressionStateObject.

Parameters
parent:StateObject

The parent of this state object, which cannot be null

stateObject:StateObject

The StateObject representing the encapsulated expression

Exceptions
NullPointerException:
The given parent cannot be null
SubExpressionStateObjectback to summary
public SubExpressionStateObject(StateObject parent, String jpqlFragment, String queryBNFId)

Creates a new SubExpressionStateObject.

Parameters
parent:StateObject

The parent of this state object, which cannot be null

jpqlFragment:String

The portion of the query representing the encapsulated expression

queryBNFId:String

The unique identifier of the .JPQLQueryBNF JPQLQueryBNF that is used to parse the encapsulated expression

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 SubExpression getExpression()

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractSingleEncapsulatedExpressionStateObject.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:SubExpression

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
getIdentifierback to summary
public String getIdentifier()

Implements abstract org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractEncapsulatedExpressionStateObject.getIdentifier.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractEncapsulatedExpressionStateObject.getIdentifier.

Returns the JPQL identifier of the expression represented by this AbstractSingleEncapsulatedExpressionStateObject.

Returns:String

The JPQL identifier that is shown before the left parenthesis

Annotations
@Override
getQueryBNFIdback to summary
protected String getQueryBNFId()

Implements abstract org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractSingleEncapsulatedExpressionStateObject.getQueryBNFId.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractSingleEncapsulatedExpressionStateObject.getQueryBNFId.

Returns the unique identifier of the JPQLQueryBNF that will determine how to parse the encapsulated expression.

Returns:String

The non-null ID of the BNF

Annotations
@Override
setExpressionback to summary
public void setExpression(SubExpression 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:SubExpression

The parsed object representing an encapsulated expression

setQueryBNFIdback to summary
public void setQueryBNFId(String queryBNFId)

Sets the unique identifier of the JPQLQueryBNF that is used to parse the encapsulated expression.

Parameters
queryBNFId:String

The non-null ID of the BNF

Exceptions
NullPointerException:
The query BNF ID cannot be null
setStateObjectback to summary
public void setStateObject(StateObject stateObject)

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractSingleEncapsulatedExpressionStateObject.setStateObject.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractSingleEncapsulatedExpressionStateObject.setStateObject.

Sets the given StateObject to represent the new encapsulated expression.

Parameters
stateObject:StateObject

The new encapsulated StateObject

Annotations
@Override