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

public abstract Class AbstractTripleEncapsulatedExpressionStateObject

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

This state object takes care of parsing an expression that encapsulates three expressions separated by a comma.

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

Author
Pascal Filion
Since
2.4
Version
2.4
See Also
LocateExpressionStateObject, SubstringExpressionStateObject, AbstractTripleEncapsulatedExpression

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.

public static final String
THIRD_STATE_OBJECT_PROPERTY

Notifies the third StateObject property has changed.

private StateObject
thirdStateObject

The StateObject representing the third expression.

Constructor Summary

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

Creates a new AbstractTripleEncapsulatedExpressionStateObject.

protected
AbstractTripleEncapsulatedExpressionStateObject(StateObject
The parent of this state object, which cannot be null
parent
,
StateObject
The StateObject of the first encapsulated expression
firstStateObject
,
StateObject
The StateObject of the second encapsulated expression
secondStateObject
,
StateObject
The StateObject of the third encapsulated expression
thirdStateObject
)

Creates a new AbstractTripleEncapsulatedExpressionStateObject.

protected
AbstractTripleEncapsulatedExpressionStateObject(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
,
String
The string representation of the third encapsulated expression to parse and to convert into a StateObject representation
thirdJpqlFragment
)

Creates a new AbstractTripleEncapsulatedExpressionStateObject.

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 AbstractTripleEncapsulatedExpression
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 StateObject

Returns:

The third encapsulated StateObject or null if none exists
getThird
()

Returns the StateObject representing the third expression.

protected abstract String

Returns:

The query BNF ID for the third encapsulated expression
getThirdQueryBNFId
()

Returns the unique identifier of the BNF that will be used to parse a JPQL fragment as the third 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

Returns:

true if the third StateObject is not null; false otherwise
hasThird
()

Determines whether the StateObject representing the third 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
parseThird(String
The string representation of the third encapsulated expression to parse and to convert into a StateObject representation
jpqlFragment
)

Parses the given JPQL fragment, which will represent the third 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.

public void
setThird(StateObject
The new encapsulated StateObject representing the third expression
thirdStateObject
)

Sets the given StateObject to represent the third 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.

THIRD_STATE_OBJECT_PROPERTYback to summary
public static final String THIRD_STATE_OBJECT_PROPERTY

Notifies the third StateObject property has changed.

thirdStateObjectback to summary
private StateObject thirdStateObject

The StateObject representing the third expression.

Constructor Detail

AbstractTripleEncapsulatedExpressionStateObjectback to summary
protected AbstractTripleEncapsulatedExpressionStateObject(StateObject parent)

Creates a new AbstractTripleEncapsulatedExpressionStateObject.

Parameters
parent:StateObject

The parent of this state object, which cannot be null

Exceptions
NullPointerException:
The given parent cannot be null
AbstractTripleEncapsulatedExpressionStateObjectback to summary
protected AbstractTripleEncapsulatedExpressionStateObject(StateObject parent, StateObject firstStateObject, StateObject secondStateObject, StateObject thirdStateObject)

Creates a new AbstractTripleEncapsulatedExpressionStateObject.

Parameters
parent:StateObject

The parent of this state object, which cannot be null

firstStateObject:StateObject

The StateObject of the first encapsulated expression

secondStateObject:StateObject

The StateObject of the second encapsulated expression

thirdStateObject:StateObject

The StateObject of the third encapsulated expression

Exceptions
NullPointerException:
The given parent cannot be null
AbstractTripleEncapsulatedExpressionStateObjectback to summary
protected AbstractTripleEncapsulatedExpressionStateObject(StateObject parent, String firstJpqlFragment, String secondJpqlFragment, String thirdJpqlFragment)

Creates a new AbstractTripleEncapsulatedExpressionStateObject.

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

thirdJpqlFragment:String

The string representation of the third 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 AbstractTripleEncapsulatedExpression 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:AbstractTripleEncapsulatedExpression

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

getThirdback to summary
public StateObject getThird()

Returns the StateObject representing the third expression.

Returns:StateObject

The third encapsulated StateObject or null if none exists

getThirdQueryBNFIdback to summary
protected abstract String getThirdQueryBNFId()

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

Returns:String

The query BNF ID for the third 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

hasThirdback to summary
public boolean hasThird()

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

Returns:boolean

true if the third 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

parseThirdback to summary
public void parseThird(String jpqlFragment)

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

Parameters
jpqlFragment:String

The string representation of the third 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

setThirdback to summary
public void setThird(StateObject thirdStateObject)

Sets the given StateObject to represent the third encapsulated expression.

Parameters
thirdStateObject:StateObject

The new encapsulated StateObject representing the third 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