org.modeshape.jcr.query.qom
Class JcrAbstractQuery

java.lang.Object
  extended by org.modeshape.jcr.query.qom.JcrAbstractQuery
All Implemented Interfaces:
Query
Direct Known Subclasses:
JcrQuery, JcrSearch

public abstract class JcrAbstractQuery
extends Object
implements Query

Abstract implementation of JCR's Query interface.


Field Summary
protected  JcrQueryContext context
           
protected  String language
           
protected  String statement
           
 
Fields inherited from interface javax.jcr.query.Query
JCR_JQOM, JCR_SQL2, SQL, XPATH
 
Constructor Summary
protected JcrAbstractQuery(JcrQueryContext context, String statement, String language, Path storedAtPath)
          Creates a new JCR Query by specifying the query statement itself, the language in which the query is stated, the QueryCommand representation and, optionally, the node from which the query was loaded.
 
Method Summary
protected  void checkForProblems(Problems problems)
           
protected  JcrQueryContext context()
           
 String getLanguage()
          
 String getStatement()
          
 String getStoredQueryPath()
          
protected  Path pathFor(String path)
           
 Node storeAsNode(String absPath)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.jcr.query.Query
bindValue, execute, getBindVariableNames, setLimit, setOffset
 

Field Detail

context

protected final JcrQueryContext context

language

protected final String language

statement

protected final String statement
Constructor Detail

JcrAbstractQuery

protected JcrAbstractQuery(JcrQueryContext context,
                           String statement,
                           String language,
                           Path storedAtPath)
Creates a new JCR Query by specifying the query statement itself, the language in which the query is stated, the QueryCommand representation and, optionally, the node from which the query was loaded. The language must be a string from among those returned by QueryManager#getSupportedQueryLanguages().

Parameters:
context - the context that was used to create this query and that will be used to execute this query; may not be null
statement - the original statement as supplied by the client; may not be null
language - the language obtained from the QueryParser; may not be null
storedAtPath - the path at which this query was stored, or null if this is not a stored query
Method Detail

context

protected final JcrQueryContext context()

pathFor

protected final Path pathFor(String path)

getLanguage

public String getLanguage()

Specified by:
getLanguage in interface Query
See Also:
Query.getLanguage()

getStatement

public String getStatement()

Specified by:
getStatement in interface Query
See Also:
Query.getStatement()

getStoredQueryPath

public String getStoredQueryPath()
                          throws ItemNotFoundException

Specified by:
getStoredQueryPath in interface Query
Throws:
ItemNotFoundException
See Also:
Query.getStoredQueryPath()

storeAsNode

public Node storeAsNode(String absPath)
                 throws PathNotFoundException,
                        ConstraintViolationException,
                        RepositoryException

Specified by:
storeAsNode in interface Query
Throws:
PathNotFoundException
ConstraintViolationException
RepositoryException
See Also:
Query.storeAsNode(java.lang.String)

checkForProblems

protected void checkForProblems(Problems problems)
                         throws RepositoryException
Throws:
RepositoryException


Copyright © 2008-2011 JBoss, a division of Red Hat. All Rights Reserved.