Class SimpleStateObject
java.lang.Object
org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject
org.eclipse.persistence.jpa.jpql.tools.model.query.SimpleStateObject
- All Implemented Interfaces:
StateObject
- Direct Known Subclasses:
AbstractSchemaNameStateObject,BadExpressionStateObject,DateTimeStateObject,EntityTypeLiteralStateObject,EnumTypeStateObject,IdentificationVariableStateObject,InputParameterStateObject,KeywordExpressionStateObject,NumericLiteralStateObject,StringLiteralStateObject,UnknownExpressionStateObject
This
StateObject simply holds onto a string.- Since:
- 2.4
- Version:
- 2.4
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSimpleStateObject(StateObject parent) Creates a newSimpleStateObject.protectedSimpleStateObject(StateObject parent, String text) Creates a newSimpleStateObject. -
Method Summary
Modifier and TypeMethodDescriptiongetText()Returns the text held by this state object.booleanhasText()Determines whether this state object is holding a non-empty string.booleanisEquivalent(StateObject stateObject) Determines whether the givenStateObjectis equivalent to this one, i.e.voidSets the text held by this state object.protected voidsetTextInternally(String text) Sets the text to the given value without notifying the listeners.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, addChildren, addProblems, addPropertyChangeListener, areEquivalent, buildProblem, buildProblem, buildStateObject, buildStateObjects, checkParent, children, decorate, equals, findIdentificationVariable, firePropertyChanged, getChangeSupport, getDeclaration, getDecorator, getExpression, getGrammar, getManagedTypeProvider, getParent, getQueryBuilder, getRoot, getType, getType, getTypeHelper, getTypeRepository, hashCode, initialize, isDecorated, parent, parent, parent, removePropertyChangeListener, setExpression, setParent, toString, toString, toStringInternal, toStringItems, toTextMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject
accept
-
Field Details
-
TEXT_PROPERTY
Notifies the text property has changed.- See Also:
-
-
Constructor Details
-
SimpleStateObject
Creates a newSimpleStateObject.- Parameters:
parent- The parent of this state object, which cannot benull- Throws:
NullPointerException- The given parent cannot benull
-
SimpleStateObject
Creates a newSimpleStateObject.- Parameters:
parent- The parent of this state object, which cannot benulltext- The text held by this state object- Throws:
NullPointerException- The given parent cannot benull
-
-
Method Details
-
getText
Returns the text held by this state object.- Returns:
- This model's text value
-
hasText
public boolean hasText()Determines whether this state object is holding a non-empty string.- Returns:
trueif the text is non-empty;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
-
setText
Sets the text held by this state object.- Parameters:
text- This model's text value
-
setTextInternally
Sets the text to the given value without notifying the listeners.- Parameters:
text- This model's text value
-
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
-