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

public abstract Class SimpleStateObject

extends AbstractStateObject
Class Inheritance
Known Direct Subclasses
org.eclipse.persistence.jpa.jpql.tools.model.query.StringLiteralStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.UnknownExpressionStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractSchemaNameStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.BadExpressionStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.DateTimeStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.EntityTypeLiteralStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.EnumTypeStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.IdentificationVariableStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.InputParameterStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.KeywordExpressionStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.NumericLiteralStateObject
Annotations
@SuppressWarnings:nls
Imports
java.io.IOException, org.eclipse.persistence.jpa.jpql.ExpressionTools

This StateObject simply holds onto a string.
Author
Pascal Filion
Since
2.4
Version
2.4

Field Summary

Modifier and TypeField and Description
private String
text

The text held by this state object.

public static final String
TEXT_PROPERTY

Notifies the text property has changed.

Constructor Summary

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

Creates a new SimpleStateObject.

protected
SimpleStateObject(StateObject
The parent of this state object, which cannot be null
parent
,
String
The text held by this state object
text
)

Creates a new SimpleStateObject.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

This model's text value
getText
()

Returns the text held by this state object.

public boolean

Returns:

true if the text is non-empty; false otherwise
hasText
()

Determines whether this state object is holding a non-empty string.

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
setText(String
This model's text value
text
)

Sets the text held by this state object.

protected void
setTextInternally(String
This model's text value
text
)

Sets the text to the given value without notifying the listeners.

protected void
toTextInternal(Appendable
The writer used to print out the string representation
writer
)

Implements abstract org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject.toTextInternal.

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

Field Detail

textback to summary
private String text

The text held by this state object.

TEXT_PROPERTYback to summary
public static final String TEXT_PROPERTY

Notifies the text property has changed.

Constructor Detail

SimpleStateObjectback to summary
protected SimpleStateObject(StateObject parent)

Creates a new SimpleStateObject.

Parameters
parent:StateObject

The parent of this state object, which cannot be null

Exceptions
NullPointerException:
The given parent cannot be null
SimpleStateObjectback to summary
protected SimpleStateObject(StateObject parent, String text)

Creates a new SimpleStateObject.

Parameters
parent:StateObject

The parent of this state object, which cannot be null

text:String

The text held by this state object

Exceptions
NullPointerException:
The given parent cannot be null

Method Detail

getTextback to summary
public String getText()

Returns the text held by this state object.

Returns:String

This model's text value

hasTextback to summary
public boolean hasText()

Determines whether this state object is holding a non-empty string.

Returns:boolean

true if the text is non-empty; 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
setTextback to summary
public void setText(String text)

Sets the text held by this state object.

Parameters
text:String

This model's text value

setTextInternallyback to summary
protected void setTextInternally(String text)

Sets the text to the given value without notifying the listeners.

Parameters
text:String

This model's text value

toTextInternalback to summary
protected void toTextInternal(Appendable writer) throws IOException

Implements abstract org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject.toTextInternal.

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

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.

Parameters
writer:Appendable

The writer used to print out the string representation

Annotations
@Override
Exceptions
IOException:
This should never happens, it is only required because Appendable is used instead of any concrete class