public class ConstructorExpressionStateObject extends AbstractListHolderStateObject<StateObject>
SELECT
clause a constructor may be used in the SELECT
list to return one or more Java instances. The specified class is not required to be an entity or
to be mapped to the database. The constructor name must be fully qualified.
constructor_expression ::= NEW constructor_name(constructor_item {, constructor_item}*)
ConstructorExpression
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_NAME_PROPERTY
Notifies the class name property has changed.
|
static java.lang.String |
CONSTRUCTOR_ITEMS_LIST
Notify the list of
StateObjects representing the constructor items. |
Constructor and Description |
---|
ConstructorExpressionStateObject(StateObject parent)
Creates a new
ConstructorExpressionStateObject . |
ConstructorExpressionStateObject(StateObject parent,
java.lang.Class<?> type)
Creates a new
ConstructorExpressionStateObject . |
ConstructorExpressionStateObject(StateObject parent,
java.lang.Class<?> type,
java.util.List<? extends StateObject> constructorItems)
Creates a new
ConstructorExpressionStateObject . |
ConstructorExpressionStateObject(StateObject parent,
java.lang.Class<?> type,
java.lang.String jpqlFragment)
Creates a new
ConstructorExpressionStateObject . |
ConstructorExpressionStateObject(StateObject parent,
java.lang.String className)
Creates a new
ConstructorExpressionStateObject . |
ConstructorExpressionStateObject(StateObject parent,
java.lang.String className,
java.util.List<? extends StateObject> constructorItems)
Creates a new
ConstructorExpressionStateObject . |
ConstructorExpressionStateObject(StateObject parent,
java.lang.String className,
java.lang.String jpqlFragment)
Creates a new
ConstructorExpressionStateObject . |
Modifier and Type | Method and Description |
---|---|
void |
accept(StateObjectVisitor visitor)
Visits this
StateObject by the given visitor . |
java.lang.String |
getClassName()
Returns the fully qualified class name that will be used to retrieve the constructor.
|
ConstructorExpression |
getExpression()
Returns the actual parsed object if this
StateObject representation of the JPQL query
was created by parsing an existing JPQL query. |
IType |
getType()
Returns the actual
IType that was resolved or null if it could not be resolved. |
boolean |
isEquivalent(StateObject stateObject)
Determines whether the given
StateObject is equivalent to this one, i.e. |
void |
parse(java.lang.String jpqlFragment)
Parses the given JPQL fragment, which represents the constructor's arguments.
|
void |
setClassName(java.lang.CharSequence className)
Sets the fully qualified class name that will be used to retrieve the constructor.
|
void |
setClassName(java.lang.Class<?> type)
Sets the fully qualified class name that will be used to retrieve the constructor.
|
void |
setExpression(ConstructorExpression expression)
Keeps a reference of the
parsed object object, which should only
be done when this object is instantiated during the conversion of a parsed JPQL query into
StateObjects . |
void |
setType(IType type)
Sets the actual
IType and updates the class name. |
addItem, addItems, addListChangeListener, canMoveDown, canMoveUp, getItem, hasItems, items, itemsSize, moveDown, moveUp, removeItem, removeItems, removeListChangeListener
addPropertyChangeListener, children, decorate, equals, findIdentificationVariable, getDeclaration, getDecorator, getGrammar, getManagedTypeProvider, getParent, getQueryBuilder, getRoot, getType, getType, getTypeHelper, getTypeRepository, hashCode, isDecorated, removePropertyChangeListener, setExpression, setParent, toString, toString, toText
addPropertyChangeListener, children, decorate, findIdentificationVariable, getDeclaration, getDecorator, getGrammar, getManagedTypeProvider, getParent, getQueryBuilder, getRoot, isDecorated, removePropertyChangeListener, setParent, toString, toText
public static final java.lang.String CLASS_NAME_PROPERTY
public static final java.lang.String CONSTRUCTOR_ITEMS_LIST
StateObjects
representing the constructor items.public ConstructorExpressionStateObject(StateObject parent)
ConstructorExpressionStateObject
.parent
- The parent of this state object, which cannot be null
java.lang.NullPointerException
- The given parent cannot be null
public ConstructorExpressionStateObject(StateObject parent, java.lang.Class<?> type)
ConstructorExpressionStateObject
.parent
- The parent of this state object, which cannot be null
type
- The fully qualified name of the Java class to instantiatejava.lang.NullPointerException
- The given parent cannot be null
public ConstructorExpressionStateObject(StateObject parent, java.lang.Class<?> type, java.util.List<? extends StateObject> constructorItems)
ConstructorExpressionStateObject
.parent
- The parent of this state object, which cannot be null
type
- The Java class to instantiateconstructorItems
- The list of argumentsjava.lang.NullPointerException
- The given parent cannot be null
public ConstructorExpressionStateObject(StateObject parent, java.lang.Class<?> type, java.lang.String jpqlFragment)
ConstructorExpressionStateObject
.parent
- The parent of this state object, which cannot be null
type
- The Java class to instantiatejpqlFragment
- The portion of the JPQL query that represents the constructor's argumentsjava.lang.NullPointerException
- The given parent cannot be null
public ConstructorExpressionStateObject(StateObject parent, java.lang.String className)
ConstructorExpressionStateObject
.parent
- The parent of this state object, which cannot be null
className
- The fully qualified name of the Java class to instantiatejava.lang.NullPointerException
- The given parent cannot be null
public ConstructorExpressionStateObject(StateObject parent, java.lang.String className, java.util.List<? extends StateObject> constructorItems)
ConstructorExpressionStateObject
.parent
- The parent of this state object, which cannot be null
className
- The fully qualified name of the Java class to instantiateconstructorItems
- The list of argumentsjava.lang.NullPointerException
- The given parent cannot be null
public ConstructorExpressionStateObject(StateObject parent, java.lang.String className, java.lang.String jpqlFragment)
ConstructorExpressionStateObject
.parent
- The parent of this state object, which cannot be null
className
- The fully qualified name of the Java class to instantiatejpqlFragment
- The portion of the JPQL query that represents the constructor's argumentsjava.lang.NullPointerException
- The given parent cannot be null
public void accept(StateObjectVisitor visitor)
StateObject
by the given visitor
.visitor
- The visitor
to visit this objectpublic java.lang.String getClassName()
public ConstructorExpression getExpression()
StateObject
representation of the JPQL query
was created by parsing an existing JPQL query.getExpression
in interface StateObject
getExpression
in class AbstractStateObject
StateObject
or null
when the JPQL query is manually created (i.e. not from a string)public IType getType()
IType
that was resolved or null
if it could not be resolved.IType
public boolean isEquivalent(StateObject stateObject)
AbstractStateObject
StateObject
is equivalent to this one, i.e. the
information of both StateObject
is the same.isEquivalent
in interface StateObject
isEquivalent
in class AbstractStateObject
stateObject
- The StateObject
to compare its content to this onetrue
if both object are equivalent; false
otherwisepublic void parse(java.lang.String jpqlFragment)
jpqlFragment
- The JPQL fragment, which represents either a single or multiple argumentspublic void setClassName(java.lang.CharSequence className)
className
- The fully qualified class namepublic void setClassName(java.lang.Class<?> type)
type
- The type used to retrieve its fully qualified class namepublic void setExpression(ConstructorExpression expression)
parsed object
object, which should only
be done when this object is instantiated during the conversion of a parsed JPQL query into
StateObjects
.expression
- The parsed object
representing a NEW
expressionEclipseLink 2.6.3, "build v20160428-59c81c5" API Reference