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

public abstract Class AbstractDoubleEncapsulatedExpressionStateObject

extends AbstractEncapsulatedExpressionStateObject
Class Inheritance
Known Direct Subclasses
org.eclipse.persistence.jpa.jpql.tools.model.query.ModExpressionStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.NullIfExpressionStateObject
Annotations
@SuppressWarnings:nls
Imports
java.io.IOException, java.util.List, org.eclipse.persistence.jpa.jpql.parser.AbstractDoubleEncapsulatedExpression

This StateObject represents a JPQL expression that has a JPQL identifier followed by two an encapsulated expression with parenthesis, the two expression are separated by a comma.

BNF: expression ::= <identifier>(first_expression, second_expression)

Author
Pascal Filion
Since
2.4
Version
2.4
See Also
ModExpressionStateObject, NullIfExpressionStateObject, AbstractDoubleEncapsulatedExpression

Field Summary

Modifier and TypeField and Description
public static final String
FIRST_STATE_OBJECT_PROPERTY

Notifies the first StateObject property has changed.

private StateObject
firstStateObject

The StateObject representing the first expression.

public static final String
SECOND_STATE_OBJECT_PROPERTY

Notifies the second StateObject property has changed.

private StateObject
secondStateObject

The StateObject representing the second expression.

Constructor Summary

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

Creates a new AbstractDoubleEncapsulatedExpressionStateObject.

protected
AbstractDoubleEncapsulatedExpressionStateObject(StateObject
The parent of this state object, which cannot be null
parent
,
StateObject
The StateObject representing the first expression
firstStateObject
,
StateObject
The StateObject representing the second expression
secondStateObject
)

Creates a new AbstractDoubleEncapsulatedExpressionStateObject.

public
AbstractDoubleEncapsulatedExpressionStateObject(StateObject
The parent of this state object, which cannot be null
parent
,
String
The string representation of the first encapsulated expression to parse and to convert into a StateObject representation
firstJpqlFragment
,
String
The string representation of the second encapsulated expression to parse and to convert into a StateObject representation
secondJpqlFragment
)

Creates a new AbstractDoubleEncapsulatedExpressionStateObject.

Method Summary

Modifier and TypeMethod and Description
protected void
addChildren(List<StateObject>
The list used to store the children
children
)

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

Adds the children of this StateObject to the given list.
public AbstractDoubleEncapsulatedExpression
getExpression()

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractEncapsulatedExpressionStateObject.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 StateObject

Returns:

The first encapsulated StateObject or null if none exists
getFirst
()

Returns the StateObject representing the first expression.

protected abstract String

Returns:

The query BNF ID for the first encapsulated expression
getFirstQueryBNFId
()

Returns the unique identifier of the BNF that will be used to parse a JPQL fragment as the first encapsulated expression.

public StateObject

Returns:

The second encapsulated StateObject or null if none exists
getSecond
()

Returns the StateObject representing the second expression.

protected abstract String

Returns:

The query BNF ID for the second encapsulated expression
getSecondQueryBNFId
()

Returns the unique identifier of the BNF that will be used to parse a JPQL fragment as the second encapsulated expression.

public boolean

Returns:

true if the first StateObject is not null; false otherwise
hasFirst
()

Determines whether the StateObject representing the first encapsulated expression is present or not.

public boolean

Returns:

true if the second StateObject is not null; false otherwise
hasSecond
()

Determines whether the StateObject representing the second encapsulated expression is present or not.

public boolean
isEquivalent(StateObject
The StateObject to compare its content to this one
stateObject
)

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

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

Determines whether the given StateObject is equivalent to this one, i.e. the information of both StateObject is the same.
public void
parseFirst(String
The string representation of the first encapsulated expression to parse and to convert into a StateObject representation
jpqlFragment
)

Parses the given JPQL fragment, which will represent the first encapsulated expression.

public void
parseSecond(String
The string representation of the second encapsulated expression to parse and to convert into a StateObject representation
jpqlFragment
)

Parses the given JPQL fragment, which will represent the second encapsulated expression.

public void
setFirst(StateObject
The new encapsulated StateObject representing the first expression
firstStateObject
)

Sets the given StateObject to represent the first encapsulated expression.

public void
setSecond(StateObject
The new encapsulated StateObject representing the second expression
secondStateObject
)

Sets the given StateObject to represent the second encapsulated expression.

protected void
toTextEncapsulatedExpression(Appendable
The writer used to print out the string representation of the encapsulated information
writer
)

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

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.
Inherited from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractEncapsulatedExpressionStateObject:
getIdentifiertoTextInternal

Field Detail

FIRST_STATE_OBJECT_PROPERTYback to summary
public static final String FIRST_STATE_OBJECT_PROPERTY

Notifies the first StateObject property has changed.

firstStateObjectback to summary
private StateObject firstStateObject

The StateObject representing the first expression.

SECOND_STATE_OBJECT_PROPERTYback to summary
public static final String SECOND_STATE_OBJECT_PROPERTY

Notifies the second StateObject property has changed.

secondStateObjectback to summary
private StateObject secondStateObject

The StateObject representing the second expression.

Constructor Detail

AbstractDoubleEncapsulatedExpressionStateObjectback to summary
protected AbstractDoubleEncapsulatedExpressionStateObject(StateObject parent)

Creates a new AbstractDoubleEncapsulatedExpressionStateObject.

Parameters
parent:StateObject

The parent of this state object, which cannot be null

Exceptions
NullPointerException:
The given parent cannot be null
AbstractDoubleEncapsulatedExpressionStateObjectback to summary
protected AbstractDoubleEncapsulatedExpressionStateObject(StateObject parent, StateObject firstStateObject, StateObject secondStateObject)

Creates a new AbstractDoubleEncapsulatedExpressionStateObject.

Parameters
parent:StateObject

The parent of this state object, which cannot be null

firstStateObject:StateObject

The StateObject representing the first expression

secondStateObject:StateObject

The StateObject representing the second expression

Exceptions
NullPointerException:
The given parent cannot be null
AbstractDoubleEncapsulatedExpressionStateObjectback to summary
public AbstractDoubleEncapsulatedExpressionStateObject(StateObject parent, String firstJpqlFragment, String secondJpqlFragment)

Creates a new AbstractDoubleEncapsulatedExpressionStateObject.

Parameters
parent:StateObject

The parent of this state object, which cannot be null

firstJpqlFragment:String

The string representation of the first encapsulated expression to parse and to convert into a StateObject representation

secondJpqlFragment:String

The string representation of the second encapsulated expression to parse and to convert into a StateObject representation

Exceptions
NullPointerException:
The given parent cannot be null

Method Detail

addChildrenback to summary
protected void addChildren(List<StateObject> children)

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

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject.addChildren.

Adds the children of this StateObject to the given list.

Parameters
children:List<StateObject>

The list used to store the children

Annotations
@Override
getExpressionback to summary
public AbstractDoubleEncapsulatedExpression getExpression()

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

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
getFirstback to summary
public StateObject getFirst()

Returns the StateObject representing the first expression.

Returns:StateObject

The first encapsulated StateObject or null if none exists

getFirstQueryBNFIdback to summary
protected abstract String getFirstQueryBNFId()

Returns the unique identifier of the BNF that will be used to parse a JPQL fragment as the first encapsulated expression.

Returns:String

The query BNF ID for the first encapsulated expression

getSecondback to summary
public StateObject getSecond()

Returns the StateObject representing the second expression.

Returns:StateObject

The second encapsulated StateObject or null if none exists

getSecondQueryBNFIdback to summary
protected abstract String getSecondQueryBNFId()

Returns the unique identifier of the BNF that will be used to parse a JPQL fragment as the second encapsulated expression.

Returns:String

The query BNF ID for the second encapsulated expression

hasFirstback to summary
public boolean hasFirst()

Determines whether the StateObject representing the first encapsulated expression is present or not.

Returns:boolean

true if the first StateObject is not null; false otherwise

hasSecondback to summary
public boolean hasSecond()

Determines whether the StateObject representing the second encapsulated expression is present or not.

Returns:boolean

true if the second StateObject is not null; false otherwise

isEquivalentback to summary
public boolean isEquivalent(StateObject stateObject)

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

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

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

Determines whether the given StateObject is equivalent to this one, i.e. the information of both StateObject is the same.

Parameters
stateObject:StateObject

The StateObject to compare its content to this one

Returns:boolean

true if both object are equivalent; false otherwise

Annotations
@Override
parseFirstback to summary
public void parseFirst(String jpqlFragment)

Parses the given JPQL fragment, which will represent the first encapsulated expression.

Parameters
jpqlFragment:String

The string representation of the first encapsulated expression to parse and to convert into a StateObject representation

parseSecondback to summary
public void parseSecond(String jpqlFragment)

Parses the given JPQL fragment, which will represent the second encapsulated expression.

Parameters
jpqlFragment:String

The string representation of the second encapsulated expression to parse and to convert into a StateObject representation

setFirstback to summary
public void setFirst(StateObject firstStateObject)

Sets the given StateObject to represent the first encapsulated expression.

Parameters
firstStateObject:StateObject

The new encapsulated StateObject representing the first expression

setSecondback to summary
public void setSecond(StateObject secondStateObject)

Sets the given StateObject to represent the second encapsulated expression.

Parameters
secondStateObject:StateObject

The new encapsulated StateObject representing the second expression

toTextEncapsulatedExpressionback to summary
protected void toTextEncapsulatedExpression(Appendable writer) throws IOException

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

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

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.

Parameters
writer:Appendable

The writer used to print out the string representation of the encapsulated information

Annotations
@Override
Exceptions
IOException:
This should never happens, only required because Appendable is used instead of StringBuilder for instance