EclipseLink 2.4.2, build 'v20130514-5956486' API Reference

org.eclipse.persistence.jpa.jpql.model.query
Class SimpleStateObject

java.lang.Object
  extended by org.eclipse.persistence.jpa.jpql.model.query.AbstractStateObject
      extended by org.eclipse.persistence.jpa.jpql.model.query.SimpleStateObject
All Implemented Interfaces:
StateObject
Direct Known Subclasses:
AbstractSchemaNameStateObject, BadExpressionStateObject, DateTimeStateObject, EntityTypeLiteralStateObject, EnumTypeStateObject, IdentificationVariableStateObject, InputParameterStateObject, KeywordExpressionStateObject, NumericLiteralStateObject, StringLiteralStateObject, UnknownExpressionStateObject

public abstract class SimpleStateObject
extends AbstractStateObject

This StateObject simply holds onto a string.

Version:
2.4
Author:
Pascal Filion
Since:
2.4

Field Summary
static java.lang.String TEXT_PROPERTY
          Notifies the text property has changed.
 
Constructor Summary
protected SimpleStateObject(StateObject parent)
          Creates a new SimpleStateObject.
protected SimpleStateObject(StateObject parent, java.lang.String text)
          Creates a new SimpleStateObject.
 
Method Summary
 java.lang.String getText()
          Returns the text held by this state object.
 boolean hasText()
          Determines whether this state object is holding a non-empty string.
 boolean isEquivalent(StateObject stateObject)
          Determines whether the given StateObject is equivalent to this one, i.e. the information of both StateObject is the same.
 void setText(java.lang.String text)
          Sets the text held by this state object.
protected  void setTextInternally(java.lang.String text)
          Sets the text to the given value without notifying the listeners.
protected  void toTextInternal(java.lang.Appendable writer)
          Prints out a string representation of this StateObject, which should not be used to define a true string representation of a JPQL query but should be used for debugging purposes.
 
Methods inherited from class org.eclipse.persistence.jpa.jpql.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, toText
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.persistence.jpa.jpql.model.query.StateObject
accept
 

Field Detail

TEXT_PROPERTY

public static final java.lang.String TEXT_PROPERTY
Notifies the text property has changed.

See Also:
Constant Field Values
Constructor Detail

SimpleStateObject

protected SimpleStateObject(StateObject parent)
Creates a new SimpleStateObject.

Parameters:
parent - The parent of this state object, which cannot be null
Throws:
java.lang.NullPointerException - The given parent cannot be null

SimpleStateObject

protected SimpleStateObject(StateObject parent,
                            java.lang.String text)
Creates a new SimpleStateObject.

Parameters:
parent - The parent of this state object, which cannot be null
text - The text held by this state object
Throws:
java.lang.NullPointerException - The given parent cannot be null
Method Detail

getText

public java.lang.String 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:
true if the text is non-empty; false otherwise

isEquivalent

public boolean isEquivalent(StateObject stateObject)
Determines whether the given StateObject is equivalent to this one, i.e. the information of both StateObject is the same.

Specified by:
isEquivalent in interface StateObject
Overrides:
isEquivalent in class AbstractStateObject
Parameters:
stateObject - The StateObject to compare its content to this one
Returns:
true if both object are equivalent; false otherwise

setText

public void setText(java.lang.String text)
Sets the text held by this state object.

Parameters:
text - This model's text value

setTextInternally

protected void setTextInternally(java.lang.String text)
Sets the text to the given value without notifying the listeners.

Parameters:
text - This model's text value

toTextInternal

protected void toTextInternal(java.lang.Appendable writer)
                       throws java.io.IOException
Prints out a string representation of this StateObject, which should not be used to define a true string representation of a JPQL query but should be used for debugging purposes.

Specified by:
toTextInternal in class AbstractStateObject
Parameters:
writer - The writer used to print out the string representation
Throws:
java.io.IOException - This should never happens, it is only required because Appendable is used instead of any concrete class

EclipseLink 2.4.2, build 'v20130514-5956486' API Reference