|
Oracle Fusion Middleware Java API Reference for Oracle TopLink 11g Release 1 (11.1.1) E28847-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
org.eclipse.persistence.jpa.internal.jpql.parser.JPQLQueryBNF
public abstract class JPQLQueryBNF
This defines the Backus-Naur Form (BNF) of the JSR 317: Java™ Persistence 2.0.
Expression for the complete grammar
Field Summary | |
---|---|
private java.util.Set<java.lang.String> |
cachedFactories Caches the collection of unique identifiers matching the expression factories since any BNF rule is static. |
private java.util.Map<java.lang.String,ExpressionFactory> |
cachedIdentifiers Caches the identifier retrieves from all the expression factories . |
private java.util.Set<JPQLQueryBNF> |
childNonCompoundQueryBNFs Caches the children of this BNF rule (which actually includes this one as well) but do not includes BNF rules that are used for compounding a rule. |
private java.util.Set<JPQLQueryBNF> |
childQueryBNFs Caches the children of this BNF rule (which actually includes this one as well). |
private java.util.List<java.lang.String> |
children The children BNF of this one. |
private java.util.List<java.lang.String> |
expressionFactories The list of identifiers that are part of the this BNF rule. |
private java.lang.Boolean |
handleAggregate Caches the property since any BNF rule is static. |
private java.lang.Boolean |
handleCollection Caches the property since any BNF rule is static. |
private java.lang.String |
id The unique identifier of this BNF rule. |
private boolean |
traversed This flag is used to prevent cyclical loop when retrieving some properties from the child BNF rules. |
Constructor Summary | |
---|---|
JPQLQueryBNF(java.lang.String id) Creates a new JPQLQueryBNF . |
Method Summary | |
---|---|
(package private) void |
addChildren(java.util.Set<JPQLQueryBNF> queryBNFs, Filter<JPQLQueryBNF> filter) Adds to the given set the child BNF rules and requests them to add their children as long as they have not been traversed already. |
private java.util.Set<JPQLQueryBNF> |
buildChildren(Filter<JPQLQueryBNF> filter) |
private java.util.Map<java.lang.String,ExpressionFactory> |
buildIdentifiers() |
private Filter<JPQLQueryBNF> |
buildNonCompoundFilter() |
private boolean |
calculateHandleAggregate() |
private boolean |
calculateHandleCollection() |
(package private) java.util.Set<JPQLQueryBNF> |
children() Returns the set of all the query BNFs that are part of this BNF. |
ExpressionFactory |
expressionFactory(java.lang.String identifier) Retrieves the ExpressionFactory that is associated with the given identifier, if the given string is indeed a JPQL identifier. |
java.util.Set<java.lang.String> |
expressionFactoryIds() Returns the unique identifiers of the expression factories handled by this BNF rule. |
(package private) java.lang.String |
getFallbackBNFId() When parsing the query and no JPQLQueryBNFs can help to parse the query, then it will fall back on this one. |
(package private) java.lang.String |
getFallbackExpressionFactoryId() Returns the unique identifier of the ExpressionFactory to use when the fall back BNF ID is not null . |
java.lang.String |
getId() Returns the unique identifier of this JPQLQueryBNF . |
boolean |
handleAggregate() Determines whether the Expression handles a collection of sub-expressions that are aggregated by logical or arithmetic operators. |
boolean |
handleCollection() Determines whether the Expression handles a collection of sub-expressions that are separated by commas. |
boolean |
hasIdentifier(java.lang.String word) Determines if this query BNF support the given word, which can be an identifier. |
java.lang.Iterable<java.lang.String> |
identifiers() Retrieves the identifiers that are supported by this BNF. |
(package private) void |
initialize() Initializes this BNF rule by registering child BNF rules and expression factories . |
boolean |
isCompound() Determines whether this BNF has child BNFs registered only to properly parse a query or if the child BNFs are part of the BNF. |
java.util.Set<JPQLQueryBNF> |
nonCompoundChildren() Returns the set of all the query BNFs that are part of this BNF. |
private void |
populateIdentifiers() |
private JPQLQueryBNF |
queryBNF(java.lang.String id) |
(package private) void |
registerChild(java.lang.String queryBNF) Registers the unique identifier of the BNF rule as a child of this BNF rule. |
(package private) void |
registerExpressionFactory(java.lang.String expressionFactory) Registers a unique identifier that will be used to create the {@link Expression representing this BNF rule. |
java.lang.String |
toString() |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private java.util.Set<java.lang.String> cachedFactories
private java.util.Map<java.lang.String,ExpressionFactory> cachedIdentifiers
expression factories
.private java.util.Set<JPQLQueryBNF> childNonCompoundQueryBNFs
private java.util.Set<JPQLQueryBNF> childQueryBNFs
private java.util.List<java.lang.String> children
private java.util.List<java.lang.String> expressionFactories
private java.lang.Boolean handleAggregate
private java.lang.Boolean handleCollection
private java.lang.String id
private boolean traversed
Constructor Detail |
---|
JPQLQueryBNF(java.lang.String id)
JPQLQueryBNF
.
id
- The unique identifier of this BNF ruleMethod Detail |
---|
void addChildren(java.util.Set<JPQLQueryBNF> queryBNFs, Filter<JPQLQueryBNF> filter)
queryBNFs
- The set to add the child BNF rulesfilter
- The Filter
determines if the children of a given BNF should be addedprivate java.util.Set<JPQLQueryBNF> buildChildren(Filter<JPQLQueryBNF> filter)
private java.util.Map<java.lang.String,ExpressionFactory> buildIdentifiers()
private Filter<JPQLQueryBNF> buildNonCompoundFilter()
private boolean calculateHandleAggregate()
private boolean calculateHandleCollection()
final java.util.Set<JPQLQueryBNF> children()
public final ExpressionFactory expressionFactory(java.lang.String identifier)
ExpressionFactory
that is associated with the given identifier, if the given string is indeed a JPQL identifier.identifier
- The JPQL identifier (in theory) that is used to retrieve the factory responsible to parse a portion of the query starting with that identifierExpressionFactory
responsible to parse a portion of the query starting with the given identifier; null
if nothing was registered for itpublic final java.util.Set<java.lang.String> expressionFactoryIds()
expression factories
handled by this BNF rule.ExpressionFactory
java.lang.String getFallbackBNFId()
JPQLQueryBNFs
can help to parse the query, then it will fall back on this one.JPQLQueryBNF
to use in the last resortjava.lang.String getFallbackExpressionFactoryId()
ExpressionFactory
to use when the fall back BNF ID is not null
. This will be used to parse a portion of the query when the registered expression factories
cannot parse it.
Note: This method is only called if getFallbackBNFId()
does not return null
.
ExpressionFactory
public final java.lang.String getId()
JPQLQueryBNF
.JPQLQueryBNF
with AbstractExpression
public boolean handleAggregate()
Expression
handles a collection of sub-expressions that are aggregated by logical or arithmetic operators.true
if the sub-expression to parse might have several logical and/or arithmetic expressions; false
otherwisepublic boolean handleCollection()
Expression
handles a collection of sub-expressions that are separated by commas.true
if the sub-expression to parse might have several sub-expressions separated by commas; false
otherwisepublic final boolean hasIdentifier(java.lang.String word)
word
- A word that could be a JPQL identifier or anything elsetrue
if the given word is a JPQL identifier and it is supported by this BNF; false
otherwisepublic final java.lang.Iterable<java.lang.String> identifiers()
void initialize()
BNF rules
and expression factories
.public boolean isCompound()
BetweenExpressionBNF
, it registers a series of children BNFs but they shouldn't be used to determine if they are part of that BNF since the comparator identifiers are.false
by defaultpublic final java.util.Set<JPQLQueryBNF> nonCompoundChildren()
private void populateIdentifiers()
private JPQLQueryBNF queryBNF(java.lang.String id)
final void registerChild(java.lang.String queryBNF)
queryBNF
- The unique identifier of the BNF rulefinal void registerExpressionFactory(java.lang.String expressionFactory)
expressionFactory
- The unique identifier that is responsible to create the Expression
for this BNF rulepublic java.lang.String toString()
toString
in class java.lang.Object
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |