Class NotExpressionStateObject
java.lang.Object
org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject
org.eclipse.persistence.jpa.jpql.tools.model.query.NotExpressionStateObject
- All Implemented Interfaces:
StateObject
BNF: expression ::= NOT conditional_primary
- Since:
- 2.4
- Version:
- 2.4
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringNotifies the state object property has changed. -
Constructor Summary
ConstructorsConstructorDescriptionNotExpressionStateObject(StateObject parent) Creates a newNotExpressionStateObject.NotExpressionStateObject(StateObject parent, String jpqlFragment) Creates a newNotExpressionStateObject.NotExpressionStateObject(StateObject parent, StateObject stateObject) Creates a newNotExpressionStateObject. -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(StateObjectVisitor visitor) Visits thisStateObjectby the givenvisitor.protected voidaddChildren(List<StateObject> children) Adds the children of thisStateObjectto the given list.Returns the actual parsed object if thisStateObjectrepresentation of the JPQL query was created by parsing an existing JPQL query.Returns theStateObjectrepresenting the negated expression.booleanDetermines whether theStateObjectrepresenting the encapsulated expression is present or not.booleanisEquivalent(StateObject stateObject) Determines whether the givenStateObjectis equivalent to this one, i.e.voidParses the given JPQL fragment, which represents the negated expression, and creates theStateObject.voidsetExpression(NotExpression expression) Keeps a reference of theparsed objectobject, which should only be done when this object is instantiated during the conversion of a parsed JPQL query intoStateObjects.voidsetStateObject(StateObject stateObject) Sets the givenStateObjectas the new negated expression.protected voidtoTextInternal(Appendable writer) Prints out a string representation of thisStateObject, which should not be used to define atruestring representation of a JPQL query but should be used for debugging purposes.Methods inherited from class org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject
acceptUnknownVisitor, acceptUnknownVisitor, addProblems, addPropertyChangeListener, areEquivalent, buildProblem, buildProblem, buildStateObject, buildStateObjects, checkParent, children, decorate, equals, findIdentificationVariable, firePropertyChanged, getChangeSupport, getDeclaration, getDecorator, getGrammar, getManagedTypeProvider, getParent, getQueryBuilder, getRoot, getType, getType, getTypeHelper, getTypeRepository, hashCode, initialize, isDecorated, parent, parent, parent, removePropertyChangeListener, setExpression, setParent, toString, toString, toStringInternal, toStringItems, toText
-
Field Details
-
STATE_OBJECT_PROPERTY
Notifies the state object property has changed.- See Also:
-
-
Constructor Details
-
NotExpressionStateObject
Creates a newNotExpressionStateObject.- Parameters:
parent- The parent of this state object, which cannot benull- Throws:
NullPointerException- The given parent cannot benull
-
NotExpressionStateObject
Creates a newNotExpressionStateObject.- Parameters:
parent- The parent of this state object, which cannot benullstateObject- TheStateObjectrepresenting the negated expression- Throws:
NullPointerException- The given parent cannot benull
-
NotExpressionStateObject
Creates a newNotExpressionStateObject.- Parameters:
parent- The parent of this state object, which cannot benulljpqlFragment- The portion of the JPQL query that followsNOT, which will be parsed and converted into aStateObject- Throws:
NullPointerException- The given parent cannot benull
-
-
Method Details
-
accept
Description copied from interface:StateObjectVisits thisStateObjectby the givenvisitor.- Parameters:
visitor- Thevisitorto visit this object
-
addChildren
Description copied from class:AbstractStateObjectAdds the children of thisStateObjectto the given list.- Overrides:
addChildrenin classAbstractStateObject- Parameters:
children- The list used to store the children
-
getExpression
Description copied from interface:StateObjectReturns the actual parsed object if thisStateObjectrepresentation of the JPQL query was created by parsing an existing JPQL query.- Specified by:
getExpressionin interfaceStateObject- Overrides:
getExpressionin classAbstractStateObject- Returns:
- The parsed object when a JPQL query is parsed and converted into a
StateObjectornullwhen the JPQL query is manually created (i.e. not from a string)
-
getStateObject
Returns theStateObjectrepresenting the negated expression.- Returns:
- The
StateObjectrepresenting the negated expression
-
hasStateObject
public boolean hasStateObject()Determines whether theStateObjectrepresenting the encapsulated expression is present or not.- Returns:
trueif the encapsulatedStateObjectis notnull;falseotherwise
-
isEquivalent
Description copied from interface:StateObjectDetermines whether the givenStateObjectis equivalent to this one, i.e. the information of bothStateObjectis the same.- Specified by:
isEquivalentin interfaceStateObject- Overrides:
isEquivalentin classAbstractStateObject- Parameters:
stateObject- TheStateObjectto compare its content to this one- Returns:
trueif both object are equivalent;falseotherwise
-
parse
Parses the given JPQL fragment, which represents the negated expression, and creates theStateObject.- Parameters:
jpqlFragment- The portion of the query representing the negated expression
-
setExpression
Keeps a reference of theparsed objectobject, which should only be done when this object is instantiated during the conversion of a parsed JPQL query intoStateObjects.- Parameters:
expression- Theparsed objectrepresenting aNOTexpression
-
setStateObject
Sets the givenStateObjectas the new negated expression.- Parameters:
stateObject- TheStateObjectrepresenting the negated expression
-
toTextInternal
Description copied from class:AbstractStateObjectPrints out a string representation of thisStateObject, which should not be used to define atruestring representation of a JPQL query but should be used for debugging purposes.- Specified by:
toTextInternalin classAbstractStateObject- Parameters:
writer- The writer used to print out the string representation- Throws:
IOException- This should never happens, it is only required becauseAppendableis used instead of any concrete class
-