jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r573622 [1/2] - in /jackrabbit/trunk/jackrabbit-core/src: main/java/org/apache/jackrabbit/core/query/ main/java/org/apache/jackrabbit/core/query/jsr283/qom/ main/java/org/apache/jackrabbit/core/query/lucene/ main/java/org/apache/jackrabbit/...
Date Fri, 07 Sep 2007 16:10:02 GMT
Author: mreutegg
Date: Fri Sep  7 09:09:59 2007
New Revision: 573622

URL: http://svn.apache.org/viewvc?rev=573622&view=rev
Log:
JCR-1104: JSR 283 support
- JQOM work in progress

Added:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/Literal.java   (with props)
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/JQOM2LuceneQueryBuilder.java   (with props)
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/Transformable.java   (with props)
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/DefaultQOMTreeVisitor.java   (with props)
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/LiteralImpl.java   (with props)
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/qom/SelectorQueryTest.java   (with props)
Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/PreparedQueryImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/QueryObjectModelFactory.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/PreparedQueryImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/RangeQuery.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/WildcardQuery.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/AbstractQOMNode.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/AndImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/BindVariableValueImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/ChildNodeImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/ChildNodeJoinConditionImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/ColumnImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/ComparisonImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/DefaultTraversingQOMTreeVisitor.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/DescendantNodeImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/DescendantNodeJoinConditionImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/EquiJoinConditionImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/FullTextSearchImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/FullTextSearchScoreImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/JoinImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/LengthImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/LowerCaseImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/NodeLocalNameImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/NodeNameImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/NotImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/OrImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/OrderingImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/PropertyExistenceImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/PropertyValueImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/QOMTreeVisitor.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/QueryObjectModelFactoryImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/QueryObjectModelTree.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/SameNodeImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/SameNodeJoinConditionImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/SelectorImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/UpperCaseImpl.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/PreparedQueryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/PreparedQueryImpl.java?rev=573622&r1=573621&r2=573622&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/PreparedQueryImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/PreparedQueryImpl.java Fri Sep  7 09:09:59 2007
@@ -36,7 +36,7 @@
     /**
      * The executable prepared query.
      */
-    protected ExecutablePreparedQuery query;
+    protected ExecutablePreparedQuery prepQuery;
 
     /**
      * The query object model tree.
@@ -56,8 +56,8 @@
         this.language = language;
         this.handler = handler;
         this.statement = statement;
-        this.query = handler.createExecutablePreparedQuery(
-                session, itemMgr, createQOMTree(statement, language));
+        setExecutableQuery(handler.createExecutablePreparedQuery(
+                session, itemMgr, createQOMTree(statement, language)));
         setInitialized();
     }
 
@@ -76,10 +76,10 @@
         if (!node.isNodeType(session.getJCRName(QName.NT_QUERY))) {
             throw new InvalidQueryException("node is not of type nt:query");
         }
-        statement = node.getProperty(session.getJCRName(QName.JCR_STATEMENT)).getString();
-        language = node.getProperty(session.getJCRName(QName.JCR_LANGUAGE)).getString();
-        query = handler.createExecutablePreparedQuery(
-                session, itemMgr, createQOMTree(statement, language));
+        this.statement = node.getProperty(session.getJCRName(QName.JCR_STATEMENT)).getString();
+        this.language = node.getProperty(session.getJCRName(QName.JCR_LANGUAGE)).getString();
+        setExecutableQuery(handler.createExecutablePreparedQuery(
+                session, itemMgr, createQOMTree(statement, language)));
         setInitialized();
     }
 
@@ -98,7 +98,8 @@
         this.handler = handler;
         this.qomTree = qomTree;
         this.statement = null; // TODO: format qomTree into a SQL2 statement
-        this.query = handler.createExecutablePreparedQuery(session, itemMgr, qomTree);
+        setExecutableQuery(handler.createExecutablePreparedQuery(
+                session, itemMgr, qomTree));
         setInitialized();
     }
 
@@ -116,13 +117,23 @@
     public void bindValue(String varName, Value value)
             throws IllegalArgumentException, RepositoryException {
         try {
-            query.bindValue(session.getQName(varName), value);
+            prepQuery.bindValue(session.getQName(varName), value);
         } catch (NameException e) {
             throw new RepositoryException(e.getMessage());
         }
     }
 
     //----------------------------< internal >----------------------------------
+
+    /**
+     * Sets the executable query.
+     *
+     * @param query the executable query.
+     */
+    private void setExecutableQuery(ExecutablePreparedQuery query) {
+        super.query = query;
+        this.prepQuery = query;
+    }
 
     /**
      * Creates a {@link QueryObjectModelTree} representation for the query

Added: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/Literal.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/Literal.java?rev=573622&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/Literal.java (added)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/Literal.java Fri Sep  7 09:09:59 2007
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.core.query.jsr283.qom;
+
+/**
+ * Evaluates to a <code>Literal</code> value.
+ */
+public interface Literal extends StaticOperand {
+
+}

Propchange: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/Literal.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/QueryObjectModelFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/QueryObjectModelFactory.java?rev=573622&r1=573621&r2=573622&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/QueryObjectModelFactory.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/jsr283/qom/QueryObjectModelFactory.java Fri Sep  7 09:09:59 2007
@@ -18,6 +18,7 @@
 
 import javax.jcr.query.InvalidQueryException;
 import javax.jcr.RepositoryException;
+import javax.jcr.Value;
 
 /**
  * A <code>QueryObjectModelFactory</code> creates instances of the JCR query
@@ -561,6 +562,17 @@
      * @throws RepositoryException   if the operation otherwise fails
      */
     public BindVariableValue bindVariable(String bindVariableName)
+            throws InvalidQueryException, RepositoryException;
+
+    /**
+     * Evaluates to a literal value.
+     *
+     * @param value a JCR value; non-null
+     * @return the operand; non-null
+     * @throws InvalidQueryException if the query is invalid
+     * @throws RepositoryException   if the operation otherwise fails
+     */
+    public Literal literal(Value value)
             throws InvalidQueryException, RepositoryException;
 
     ///

Added: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/JQOM2LuceneQueryBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/JQOM2LuceneQueryBuilder.java?rev=573622&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/JQOM2LuceneQueryBuilder.java (added)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/JQOM2LuceneQueryBuilder.java Fri Sep  7 09:09:59 2007
@@ -0,0 +1,649 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.core.query.lucene;
+
+import org.apache.jackrabbit.core.query.qom.QOMTreeVisitor;
+import org.apache.jackrabbit.core.query.qom.AndImpl;
+import org.apache.jackrabbit.core.query.qom.BindVariableValueImpl;
+import org.apache.jackrabbit.core.query.qom.ChildNodeImpl;
+import org.apache.jackrabbit.core.query.qom.ChildNodeJoinConditionImpl;
+import org.apache.jackrabbit.core.query.qom.ColumnImpl;
+import org.apache.jackrabbit.core.query.qom.ComparisonImpl;
+import org.apache.jackrabbit.core.query.qom.DescendantNodeImpl;
+import org.apache.jackrabbit.core.query.qom.DescendantNodeJoinConditionImpl;
+import org.apache.jackrabbit.core.query.qom.EquiJoinConditionImpl;
+import org.apache.jackrabbit.core.query.qom.FullTextSearchImpl;
+import org.apache.jackrabbit.core.query.qom.FullTextSearchScoreImpl;
+import org.apache.jackrabbit.core.query.qom.JoinImpl;
+import org.apache.jackrabbit.core.query.qom.LengthImpl;
+import org.apache.jackrabbit.core.query.qom.LowerCaseImpl;
+import org.apache.jackrabbit.core.query.qom.NodeLocalNameImpl;
+import org.apache.jackrabbit.core.query.qom.NodeNameImpl;
+import org.apache.jackrabbit.core.query.qom.NotImpl;
+import org.apache.jackrabbit.core.query.qom.OrderingImpl;
+import org.apache.jackrabbit.core.query.qom.OrImpl;
+import org.apache.jackrabbit.core.query.qom.PropertyExistenceImpl;
+import org.apache.jackrabbit.core.query.qom.PropertyValueImpl;
+import org.apache.jackrabbit.core.query.qom.QueryObjectModelTree;
+import org.apache.jackrabbit.core.query.qom.SameNodeImpl;
+import org.apache.jackrabbit.core.query.qom.SameNodeJoinConditionImpl;
+import org.apache.jackrabbit.core.query.qom.SelectorImpl;
+import org.apache.jackrabbit.core.query.qom.UpperCaseImpl;
+import org.apache.jackrabbit.core.query.qom.ConstraintImpl;
+import org.apache.jackrabbit.core.query.qom.LiteralImpl;
+import org.apache.jackrabbit.core.query.qom.StaticOperandImpl;
+import org.apache.jackrabbit.core.query.qom.DynamicOperandImpl;
+import org.apache.jackrabbit.core.query.qom.DefaultTraversingQOMTreeVisitor;
+import org.apache.jackrabbit.core.query.PropertyTypeRegistry;
+import org.apache.jackrabbit.core.query.jsr283.qom.QueryObjectModelConstants;
+import org.apache.jackrabbit.core.query.lucene.fulltext.QueryParser;
+import org.apache.jackrabbit.core.SessionImpl;
+import org.apache.jackrabbit.core.HierarchyManager;
+import org.apache.jackrabbit.core.NodeId;
+import org.apache.jackrabbit.core.NodeImpl;
+import org.apache.jackrabbit.core.HierarchyManagerImpl;
+import org.apache.jackrabbit.core.state.ItemStateManager;
+import org.apache.jackrabbit.name.NameFormat;
+import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.name.Path;
+import org.apache.jackrabbit.name.PathFormat;
+import org.apache.lucene.analysis.Analyzer;
+import org.apache.lucene.search.Query;
+import org.apache.lucene.search.BooleanQuery;
+import org.apache.lucene.search.TermQuery;
+import org.apache.lucene.search.BooleanClause;
+import org.apache.lucene.index.Term;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.Value;
+import javax.jcr.PropertyType;
+import javax.jcr.query.InvalidQueryException;
+import javax.jcr.nodetype.NodeTypeManager;
+import javax.jcr.nodetype.NodeType;
+import javax.jcr.nodetype.NodeTypeIterator;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * Implements a query builder that takes an JQOM and creates a lucene {@link
+ * org.apache.lucene.search.Query} tree that can be executed on an index.
+ */
+public class JQOM2LuceneQueryBuilder implements QOMTreeVisitor {
+
+    /**
+     * Logger for this class
+     */
+    private static final Logger log = LoggerFactory.getLogger(JQOM2LuceneQueryBuilder.class);
+
+    /**
+     * The root of the query object model tree.
+     */
+    private final QueryObjectModelTree qomTree;
+
+    /**
+     * Session of the user executing this query
+     */
+    private final SessionImpl session;
+
+    /**
+     * The shared item state manager of the workspace.
+     */
+    private final ItemStateManager sharedItemMgr;
+
+    /**
+     * A hierarchy manager based on {@link #sharedItemMgr} to resolve paths.
+     */
+    private final HierarchyManager hmgr;
+
+    /**
+     * Namespace mappings to internal prefixes
+     */
+    private final NamespaceMappings nsMappings;
+
+    /**
+     * The analyzer instance to use for contains function query parsing
+     */
+    private final Analyzer analyzer;
+
+    /**
+     * The property type registry.
+     */
+    private final PropertyTypeRegistry propRegistry;
+
+    /**
+     * The synonym provider or <code>null</code> if none is configured.
+     */
+    private final SynonymProvider synonymProvider;
+    
+    /**
+     * Maps variable names to values.
+     */ 
+    private final Map bindVariableValues;
+
+    /**
+     * The selector queries that have already been translated into lucene
+     * queries. Key=QName (selectorName).
+     */
+    private final Map selectors = new HashMap();
+
+    /**
+     * Creates a new <code>LuceneQueryBuilder</code> instance.
+     *
+     * @param qomTree            the root of the query object model.
+     * @param session            of the user executing this query.
+     * @param sharedItemMgr      the shared item state manager of the
+     *                           workspace.
+     * @param hmgr               a hierarchy manager based on sharedItemMgr.
+     * @param nsMappings         namespace resolver for internal prefixes.
+     * @param analyzer           for parsing the query statement of the contains
+     *                           function.
+     * @param propReg            the property type registry.
+     * @param synonymProvider    the synonym provider or <code>null</code> if
+     *                           node is configured.
+     * @param bindVariableValues the bind variable values.
+     */
+    private JQOM2LuceneQueryBuilder(QueryObjectModelTree qomTree,
+                                    SessionImpl session,
+                                    ItemStateManager sharedItemMgr,
+                                    HierarchyManager hmgr,
+                                    NamespaceMappings nsMappings,
+                                    Analyzer analyzer,
+                                    PropertyTypeRegistry propReg,
+                                    SynonymProvider synonymProvider,
+                                    Map bindVariableValues) {
+        this.qomTree = qomTree;
+        this.session = session;
+        this.sharedItemMgr = sharedItemMgr;
+        this.hmgr = hmgr;
+        this.nsMappings = nsMappings;
+        this.analyzer = analyzer;
+        this.propRegistry = propReg;
+        this.synonymProvider = synonymProvider;
+        this.bindVariableValues = bindVariableValues;
+    }
+
+    /**
+     * Creates a lucene {@link org.apache.lucene.search.Query} tree from an
+     * abstract query tree.
+     *
+     * @param qomTree            the root of the query object model.
+     * @param session            of the user executing the query.
+     * @param sharedItemMgr      the shared item state manager of the
+     *                           workspace.
+     * @param nsMappings         namespace resolver for internal prefixes.
+     * @param analyzer           for parsing the query statement of the contains
+     *                           function.
+     * @param propReg            the property type registry to lookup type
+     *                           information.
+     * @param synonymProvider    the synonym provider or <code>null</code> if
+     *                           node is configured.
+     * @param bindVariableValues the bind variable values.
+     * @return the lucene query tree.
+     * @throws RepositoryException if an error occurs during the translation.
+     */
+    public static Query createQuery(QueryObjectModelTree qomTree,
+                                    SessionImpl session,
+                                    ItemStateManager sharedItemMgr,
+                                    NamespaceMappings nsMappings,
+                                    Analyzer analyzer,
+                                    PropertyTypeRegistry propReg,
+                                    SynonymProvider synonymProvider,
+                                    Map bindVariableValues)
+            throws RepositoryException {
+
+        NodeId id = ((NodeImpl) session.getRootNode()).getNodeId();
+        HierarchyManager hmgr = new HierarchyManagerImpl(
+                id, sharedItemMgr, session);
+        JQOM2LuceneQueryBuilder builder = new JQOM2LuceneQueryBuilder(
+                qomTree, session, sharedItemMgr, hmgr, nsMappings,
+                analyzer, propReg, synonymProvider, bindVariableValues);
+
+        return builder.createLuceneQuery();
+    }
+
+    private Query createLuceneQuery() throws InvalidQueryException {
+        try {
+            return (Query) qomTree.accept(this, null);
+        } catch (InvalidQueryException e) {
+            throw e;
+        } catch (Exception e) {
+            throw new InvalidQueryException(e.getMessage(), e);
+        }
+    }
+
+    //----------------------------< QOMTreeVisitor >----------------------------
+
+    public Object visit(AndImpl node, Object data) throws Exception {
+        BooleanQuery b = new BooleanQuery();
+        b.add((Query) ((ConstraintImpl) node.getConstraint1()).accept(this, data),
+                BooleanClause.Occur.MUST);
+        b.add((Query) ((ConstraintImpl) node.getConstraint2()).accept(this, data),
+                BooleanClause.Occur.MUST);
+        return b;
+    }
+
+    /**
+     * @return the {@link Value} for the passed bind variable value node.
+     * @throws InvalidQueryException if there is no value bound for the passed
+     *                               bind variable.
+     */
+    public Object visit(BindVariableValueImpl node, Object data)
+            throws InvalidQueryException {
+        Value v = (Value) bindVariableValues.get(node.getBindVariableQName());
+        if (v == null) {
+            throw new InvalidQueryException("No value bound for variable " +
+                    node.getBindVariableName());
+        } else {
+            return v;
+        }
+    }
+
+    public Object visit(ChildNodeImpl node, Object data) {
+        // TODO: implement
+        throw new UnsupportedOperationException("not yet implemented");
+    }
+
+    public Object visit(ChildNodeJoinConditionImpl node, Object data) {
+        // TODO: implement
+        throw new UnsupportedOperationException("not yet implemented");
+    }
+
+    public Object visit(ColumnImpl node, Object data) {
+        // query builder should not use this method
+        throw new IllegalStateException();
+    }
+
+    public Object visit(ComparisonImpl node, Object data) throws Exception {
+        Value v = (Value) ((StaticOperandImpl) node.getOperand2()).accept(this, data);
+        final String stringValue;
+        switch (v.getType()) {
+            case PropertyType.BINARY:
+                throw new InvalidQueryException("Binary value not supported in comparison");
+            case PropertyType.BOOLEAN:
+                stringValue = v.getString();
+                break;
+            case PropertyType.DATE:
+                stringValue = DateField.dateToString(v.getDate().getTime());
+                break;
+            case PropertyType.DOUBLE:
+                stringValue = DoubleField.doubleToString(v.getDouble());
+                break;
+            case PropertyType.LONG:
+                stringValue = LongField.longToString(v.getLong());
+                break;
+            case PropertyType.NAME:
+                stringValue = nsMappings.translatePropertyName(
+                        v.getString(), session.getNamespaceResolver());
+                break;
+            case PropertyType.PATH:
+                Path p = PathFormat.parse(v.getString(), session.getNamespaceResolver());
+                stringValue = PathFormat.format(p, nsMappings);
+                break;
+            case PropertyType.REFERENCE:
+                stringValue = v.getString();
+                break;
+            case PropertyType.STRING:
+                stringValue = v.getString();
+                break;
+            default:
+                // TODO: support for new types defined in JSR 283
+                throw new InvalidQueryException("Unsupported property type " +
+                        PropertyType.nameFromValue(v.getType()));
+        }
+
+        final int operator = node.getOperator();
+
+        return ((DynamicOperandImpl) node.getOperand1()).accept(
+                new DefaultTraversingQOMTreeVisitor() {
+            public Object visit(PropertyValueImpl node, Object data) throws Exception {
+                String propName = NameFormat.format(node.getPropertyQName(), nsMappings);
+                String text = FieldNames.createNamedValue(propName, stringValue);
+                switch (operator) {
+                    case QueryObjectModelConstants.OPERATOR_EQUAL_TO:
+                        return new TermQuery(new Term(FieldNames.PROPERTIES, text));
+                    case QueryObjectModelConstants.OPERATOR_GREATER_THAN:
+                        Term lower = new Term(FieldNames.PROPERTIES, text);
+                        Term upper = new Term(FieldNames.PROPERTIES,
+                                FieldNames.createNamedValue(propName, "\uFFFF"));
+                        return new RangeQuery(lower, upper, false);
+                    case QueryObjectModelConstants.OPERATOR_GREATER_THAN_OR_EQUAL_TO:
+                        lower = new Term(FieldNames.PROPERTIES, text);
+                        upper = new Term(FieldNames.PROPERTIES,
+                                FieldNames.createNamedValue(propName, "\uFFFF"));
+                        return new RangeQuery(lower, upper, true);
+                    case QueryObjectModelConstants.OPERATOR_LESS_THAN:
+                        lower = new Term(FieldNames.PROPERTIES,
+                                FieldNames.createNamedValue(propName, ""));
+                        upper = new Term(FieldNames.PROPERTIES, text);
+                        return new RangeQuery(lower, upper, false);
+                    case QueryObjectModelConstants.OPERATOR_LESS_THAN_OR_EQUAL_TO:
+                        lower = new Term(FieldNames.PROPERTIES,
+                                FieldNames.createNamedValue(propName, ""));
+                        upper = new Term(FieldNames.PROPERTIES, text);
+                        return new RangeQuery(lower, upper, true);
+                    case QueryObjectModelConstants.OPERATOR_LIKE:
+                        if (stringValue.equals("%")) {
+                            return new MatchAllQuery(propName);
+                        } else {
+                            return new WildcardQuery(FieldNames.PROPERTIES,
+                                    propName, stringValue);
+                        }
+                    case QueryObjectModelConstants.OPERATOR_NOT_EQUAL_TO:
+                        MatchAllQuery all = new MatchAllQuery(propName);
+                        BooleanQuery b = new BooleanQuery();
+                        b.add(all, BooleanClause.Occur.SHOULD);
+                        b.add(new TermQuery(new Term(FieldNames.PROPERTIES, text)),
+                                BooleanClause.Occur.MUST_NOT);
+                        return b;
+                    default:
+                        throw new InvalidQueryException("Unknown operator " +
+                                operator);
+                }
+            }
+
+            public Object visit(LengthImpl node, Object data) throws Exception {
+                // TODO: implement
+                return super.visit(node, data);
+            }
+
+            public Object visit(NodeLocalNameImpl node, Object data) throws Exception {
+                // TODO: implement
+                throw new UnsupportedOperationException("Not yet implemented");
+            }
+
+            public Object visit(NodeNameImpl node, Object data) throws Exception {
+                // TODO: implement
+                throw new UnsupportedOperationException("Not yet implemented");
+            }
+
+            public Object visit(FullTextSearchScoreImpl node, Object data)
+                    throws Exception {
+                // TODO: implement
+                throw new UnsupportedOperationException("Not yet implemented");
+            }
+
+            public Object visit(UpperCaseImpl node, Object data) throws Exception {
+                Object obj = super.visit(node, data);
+                if (obj instanceof Transformable) {
+                    ((Transformable) obj).setTransformation(TransformConstants.TRANSFORM_UPPER_CASE);
+                    return obj;
+                } else if (obj instanceof TermQuery) {
+                    return transformTermQuery((TermQuery) obj, true);
+                } else {
+                    throw new InvalidQueryException("upper-case not supported " +
+                            "on operand " + node.getOperand().getClass().getName());
+                }
+            }
+
+            public Object visit(LowerCaseImpl node, Object data) throws Exception {
+                Object obj = super.visit(node, data);
+                if (obj instanceof Transformable) {
+                    ((Transformable) obj).setTransformation(TransformConstants.TRANSFORM_LOWER_CASE);
+                    return obj;
+                } else if (obj instanceof TermQuery) {
+                    return transformTermQuery((TermQuery) obj, false);
+                } else {
+                    throw new InvalidQueryException("lower-case not supported " +
+                            "on operand " + node.getOperand().getClass().getName());
+                }
+            }
+
+            private Query transformTermQuery(TermQuery query, boolean toUpper)
+                    throws InvalidQueryException {
+                if (query.getTerm().field() == FieldNames.PROPERTIES) {
+                    if (toUpper) {
+                        return new CaseTermQuery.Upper(query.getTerm());
+                    } else {
+                        return new CaseTermQuery.Lower(query.getTerm());
+                    }
+                } else {
+                    throw new InvalidQueryException("Upper/LowerCase not " +
+                            "supported on field " + query.getTerm().field());
+                }
+            }
+        }, data);
+    }
+
+    public Object visit(DescendantNodeImpl node, Object data) {
+        // TODO: implement
+        throw new UnsupportedOperationException("not yet implemented");
+    }
+
+    public Object visit(DescendantNodeJoinConditionImpl node, Object data) {
+        // TODO: implement
+        throw new UnsupportedOperationException("not yet implemented");
+    }
+
+    public Object visit(EquiJoinConditionImpl node, Object data) {
+        // TODO: implement
+        throw new UnsupportedOperationException("not yet implemented");
+    }
+
+    public Object visit(FullTextSearchImpl node, Object data) throws Exception {
+        String fieldname;
+        if (node.getPropertyName() == null) {
+            // fulltext on node
+            fieldname = FieldNames.FULLTEXT;
+        } else {
+            // final path element is a property name
+            QName propName = node.getPropertyQName();
+            StringBuffer tmp = new StringBuffer();
+            tmp.append(nsMappings.getPrefix(propName.getNamespaceURI()));
+            tmp.append(":").append(FieldNames.FULLTEXT_PREFIX);
+            tmp.append(propName.getLocalName());
+            fieldname = tmp.toString();
+        }
+        QueryParser parser = new QueryParser(
+                fieldname, analyzer, synonymProvider);
+        parser.setOperator(QueryParser.DEFAULT_OPERATOR_AND);
+        // replace escaped ' with just '
+        StringBuffer query = new StringBuffer();
+        String textsearch = node.getFullTextSearchExpression();
+        // the default lucene query parser recognizes 'AND' and 'NOT' as
+        // keywords.
+        textsearch = textsearch.replaceAll("AND", "and");
+        textsearch = textsearch.replaceAll("NOT", "not");
+        boolean escaped = false;
+        for (int i = 0; i < textsearch.length(); i++) {
+            if (textsearch.charAt(i) == '\\') {
+                if (escaped) {
+                    query.append("\\\\");
+                    escaped = false;
+                } else {
+                    escaped = true;
+                }
+            } else if (textsearch.charAt(i) == '\'') {
+                if (escaped) {
+                    escaped = false;
+                }
+                query.append(textsearch.charAt(i));
+            } else {
+                if (escaped) {
+                    query.append('\\');
+                    escaped = false;
+                }
+                query.append(textsearch.charAt(i));
+            }
+        }
+        return parser.parse(query.toString());
+    }
+
+    public Object visit(FullTextSearchScoreImpl node, Object data) {
+        // TODO: implement
+        throw new UnsupportedOperationException("not yet implemented");
+    }
+
+    public Object visit(JoinImpl node, Object data) {
+        // TODO: implement
+        throw new UnsupportedOperationException("not yet implemented");
+    }
+
+    public Object visit(LengthImpl node, Object data) {
+        // TODO: implement
+        throw new UnsupportedOperationException("not yet implemented");
+    }
+
+    /**
+     * @return the {@link Value} of the literal <code>node</code>.
+     */
+    public Object visit(LiteralImpl node, Object data) {
+        return node.getValue();
+    }
+
+    public Object visit(LowerCaseImpl node, Object data) {
+        // query builder should not use this method
+        throw new IllegalStateException();
+    }
+
+    public Object visit(NodeLocalNameImpl node, Object data) {
+        // TODO: implement
+        throw new UnsupportedOperationException("not yet implemented");
+    }
+
+    public Object visit(NodeNameImpl node, Object data) {
+        // TODO: implement
+        throw new UnsupportedOperationException("not yet implemented");
+    }
+
+    public Object visit(NotImpl node, Object data) throws Exception {
+        Query c = (Query) ((ConstraintImpl) node.getConstraint()).accept(this, data);
+        return new NotQuery(c);
+    }
+
+    public Object visit(OrderingImpl node, Object data) {
+        // query builder should not use this method
+        throw new IllegalStateException();
+    }
+
+    public Object visit(OrImpl node, Object data) throws Exception {
+        BooleanQuery b = new BooleanQuery();
+        b.add((Query) ((ConstraintImpl) node.getConstraint1()).accept(this, data),
+                BooleanClause.Occur.SHOULD);
+        b.add((Query) ((ConstraintImpl) node.getConstraint2()).accept(this, data),
+                BooleanClause.Occur.SHOULD);
+        return b;
+    }
+
+    public Object visit(PropertyExistenceImpl node, Object data) throws Exception {
+        String propName = NameFormat.format(node.getPropertyQName(), nsMappings);
+        return new MatchAllQuery(propName);
+    }
+
+    public Object visit(PropertyValueImpl node, Object data) {
+        // query builder should not use this method
+        throw new IllegalStateException();
+    }
+
+    public Object visit(QueryObjectModelTree node, Object data)
+            throws Exception {
+        Query source = (Query) node.getSource().accept(this, data);
+        if (node.getConstraint() == null) {
+            return source;
+        } else {
+            Query constraint = (Query) node.getConstraint().accept(this, data);
+            BooleanQuery b = new BooleanQuery();
+            b.add(source, BooleanClause.Occur.MUST);
+            b.add(constraint, BooleanClause.Occur.MUST);
+            return b;
+        }
+    }
+
+    public Object visit(SameNodeImpl node, Object data) {
+        // TODO: implement
+        throw new UnsupportedOperationException("not yet implemented");
+    }
+
+    public Object visit(SameNodeJoinConditionImpl node, Object data) {
+        // TODO: implement
+        throw new UnsupportedOperationException("not yet implemented");
+    }
+
+    public Object visit(SelectorImpl node, Object data) throws Exception {
+        List terms = new ArrayList();
+        String mixinTypesField = NameFormat.format(QName.JCR_MIXINTYPES, nsMappings);
+        String primaryTypeField = NameFormat.format(QName.JCR_PRIMARYTYPE, nsMappings);
+
+        NodeTypeManager ntMgr = session.getWorkspace().getNodeTypeManager();
+        NodeType base = null;
+        try {
+            base = ntMgr.getNodeType(session.getJCRName(node.getNodeTypeQName()));
+        } catch (RepositoryException e) {
+            // node type does not exist
+        }
+
+        if (base != null && base.isMixin()) {
+            // search for nodes where jcr:mixinTypes is set to this mixin
+            Term t = new Term(FieldNames.PROPERTIES,
+                    FieldNames.createNamedValue(mixinTypesField,
+                            NameFormat.format(node.getNodeTypeQName(), nsMappings)));
+            terms.add(t);
+        } else {
+            // search for nodes where jcr:primaryType is set to this type
+            Term t = new Term(FieldNames.PROPERTIES,
+                    FieldNames.createNamedValue(primaryTypeField,
+                            NameFormat.format(node.getNodeTypeQName(), nsMappings)));
+            terms.add(t);
+        }
+
+        // now search for all node types that are derived from base
+        if (base != null) {
+            NodeTypeIterator allTypes = ntMgr.getAllNodeTypes();
+            while (allTypes.hasNext()) {
+                NodeType nt = allTypes.nextNodeType();
+                NodeType[] superTypes = nt.getSupertypes();
+                if (Arrays.asList(superTypes).contains(base)) {
+                    String ntName = nsMappings.translatePropertyName(nt.getName(),
+                            session.getNamespaceResolver());
+                    Term t;
+                    if (nt.isMixin()) {
+                        // search on jcr:mixinTypes
+                        t = new Term(FieldNames.PROPERTIES,
+                                FieldNames.createNamedValue(mixinTypesField, ntName));
+                    } else {
+                        // search on jcr:primaryType
+                        t = new Term(FieldNames.PROPERTIES,
+                                FieldNames.createNamedValue(primaryTypeField, ntName));
+                    }
+                    terms.add(t);
+                }
+            }
+        }
+        Query q;
+        if (terms.size() == 1) {
+            q= new TermQuery((Term) terms.get(0));
+        } else {
+            BooleanQuery b = new BooleanQuery();
+            for (Iterator it = terms.iterator(); it.hasNext();) {
+                b.add(new TermQuery((Term) it.next()), BooleanClause.Occur.SHOULD);
+            }
+            q = b;
+        }
+        selectors.put(node.getSelectorQName(), q);
+        return q;
+    }
+
+    public Object visit(UpperCaseImpl node, Object data) throws Exception {
+        // query builder should not use this method
+        throw new IllegalStateException();
+    }
+}

Propchange: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/JQOM2LuceneQueryBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/PreparedQueryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/PreparedQueryImpl.java?rev=573622&r1=573621&r2=573622&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/PreparedQueryImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/PreparedQueryImpl.java Fri Sep  7 09:09:59 2007
@@ -102,8 +102,10 @@
      */
     public QueryResult execute(long offset, long limit)
             throws RepositoryException {
-        // TODO: turn QOM tree into a lucene query
-        Query query = null;
+        Query query = JQOM2LuceneQueryBuilder.createQuery(qomTree, session,
+                index.getContext().getItemStateManager(),
+                index.getNamespaceMappings(), index.getTextAnalyzer(),
+                propReg, index.getSynonymProvider(), bindValues);
 
         ColumnImpl[] columns = qomTree.getColumns();
         QName[] selectProps = new QName[columns.length];
@@ -155,10 +157,15 @@
      */
     private void extractBindVariableNames(QueryObjectModelTree qomTree,
                                            final Set bindVariableNames) {
-        qomTree.accept(new DefaultTraversingQOMTreeVisitor() {
-            public void visit(BindVariableValueImpl node, Object data) {
-                bindVariableNames.add(node.getBindVariableQName());
-            }
-        }, null);
+        try {
+            qomTree.accept(new DefaultTraversingQOMTreeVisitor() {
+                public Object visit(BindVariableValueImpl node, Object data) {
+                    bindVariableNames.add(node.getBindVariableQName());
+                    return data;
+                }
+            }, null);
+        } catch (Exception e) {
+            // will never happen
+        }
     }
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/RangeQuery.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/RangeQuery.java?rev=573622&r1=573621&r2=573622&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/RangeQuery.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/RangeQuery.java Fri Sep  7 09:09:59 2007
@@ -45,7 +45,7 @@
  * but will calculate the matching documents itself. That way a
  * <code>TooManyClauses</code> can be avoided.
  */
-public class RangeQuery extends Query implements TransformConstants {
+public class RangeQuery extends Query implements Transformable {
 
     /**
      * Logger instance for this class.
@@ -73,7 +73,7 @@
      * How the term enum is transformed before it is compared to lower and upper
      * term.
      */
-    private final int transform;
+    private int transform = TRANSFORM_NONE;
 
     /**
      * The rewritten range query or <code>null</code> if the range spans more
@@ -88,6 +88,18 @@
      * @param lowerTerm the lower term of the interval, or <code>null</code>
      * @param upperTerm the upper term of the interval, or <code>null</code>.
      * @param inclusive if <code>true</code> the interval is inclusive.
+     */
+    public RangeQuery(Term lowerTerm, Term upperTerm, boolean inclusive) {
+        this(lowerTerm, upperTerm, inclusive, TRANSFORM_NONE);
+    }
+
+    /**
+     * Creates a new RangeQuery. The lower or the upper term may be
+     * <code>null</code>, but not both!
+     *
+     * @param lowerTerm the lower term of the interval, or <code>null</code>
+     * @param upperTerm the upper term of the interval, or <code>null</code>.
+     * @param inclusive if <code>true</code> the interval is inclusive.
      * @param transform how term enums are transformed when read from the index.
      */
     public RangeQuery(Term lowerTerm, Term upperTerm, boolean inclusive, int transform) {
@@ -108,6 +120,13 @@
         this.upperTerm = upperTerm;
         this.inclusive = inclusive;
         this.transform = transform;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setTransformation(int transformation) {
+        this.transform = transformation;
     }
 
     /**

Added: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/Transformable.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/Transformable.java?rev=573622&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/Transformable.java (added)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/Transformable.java Fri Sep  7 09:09:59 2007
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.core.query.lucene;
+
+/**
+ * <code>Transformable</code> marks queries that can transform the value to
+ * upper- or lower-case.
+ */
+public interface Transformable extends TransformConstants {
+
+    /**
+     * Sets the transformation. Must be one of the following values:
+     * <ul>
+     * <li>{@link #TRANSFORM_LOWER_CASE}</li>
+     * <li>{@link #TRANSFORM_NONE}</li>
+     * <li>{@link #TRANSFORM_UPPER_CASE}</li>
+     * </ul>
+     * @param transformation a transform constant.
+     */
+    public void setTransformation(int transformation);
+}

Propchange: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/Transformable.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/WildcardQuery.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/WildcardQuery.java?rev=573622&r1=573621&r2=573622&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/WildcardQuery.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/WildcardQuery.java Fri Sep  7 09:09:59 2007
@@ -48,7 +48,7 @@
  * <li><code>_</code> : matches exactly one character</li>
  * </ul>
  */
-public class WildcardQuery extends Query implements TransformConstants {
+public class WildcardQuery extends Query implements Transformable {
 
     /**
      * Logger instance for this class.
@@ -74,7 +74,7 @@
      * How property values are tranformed before they are matched using the
      * provided pattern.
      */
-    private final int transform;
+    private int transform = TRANSFORM_NONE;
 
     /**
      * The standard multi term query to execute wildcard queries. This is only
@@ -107,6 +107,13 @@
      */
     public WildcardQuery(String field, String propName, String pattern) {
         this(field, propName, pattern, TRANSFORM_NONE);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setTransformation(int transformation) {
+        this.transform = transformation;
     }
 
     /**

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/AbstractQOMNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/AbstractQOMNode.java?rev=573622&r1=573621&r2=573622&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/AbstractQOMNode.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/AbstractQOMNode.java Fri Sep  7 09:09:59 2007
@@ -40,7 +40,7 @@
      * @param visitor the visitor.
      * @param data    user defined data, which is passed to the visit method.
      */
-    public abstract void accept(QOMTreeVisitor visitor, Object data);
+    public abstract Object accept(QOMTreeVisitor visitor, Object data) throws Exception;
 
     //---------------------------< internal >-----------------------------------
 

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/AndImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/AndImpl.java?rev=573622&r1=573621&r2=573622&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/AndImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/AndImpl.java Fri Sep  7 09:09:59 2007
@@ -68,7 +68,7 @@
      *
      * @param visitor the visitor.
      */
-    public void accept(QOMTreeVisitor visitor, Object data) {
-        visitor.visit(this, data);
+    public Object accept(QOMTreeVisitor visitor, Object data) throws Exception {
+        return visitor.visit(this, data);
     }
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/BindVariableValueImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/BindVariableValueImpl.java?rev=573622&r1=573621&r2=573622&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/BindVariableValueImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/BindVariableValueImpl.java Fri Sep  7 09:09:59 2007
@@ -66,7 +66,7 @@
      *
      * @param visitor the visitor.
      */
-    public void accept(QOMTreeVisitor visitor, Object data) {
-        visitor.visit(this, data);
+    public Object accept(QOMTreeVisitor visitor, Object data) throws Exception {
+        return visitor.visit(this, data);
     }
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/ChildNodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/ChildNodeImpl.java?rev=573622&r1=573621&r2=573622&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/ChildNodeImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/ChildNodeImpl.java Fri Sep  7 09:09:59 2007
@@ -69,7 +69,7 @@
      *
      * @param visitor the visitor.
      */
-    public void accept(QOMTreeVisitor visitor, Object data) {
-        visitor.visit(this, data);
+    public Object accept(QOMTreeVisitor visitor, Object data) throws Exception {
+        return visitor.visit(this, data);
     }
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/ChildNodeJoinConditionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/ChildNodeJoinConditionImpl.java?rev=573622&r1=573621&r2=573622&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/ChildNodeJoinConditionImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/ChildNodeJoinConditionImpl.java Fri Sep  7 09:09:59 2007
@@ -72,7 +72,7 @@
      *
      * @param visitor the visitor.
      */
-    public void accept(QOMTreeVisitor visitor, Object data) {
-        visitor.visit(this, data);
+    public Object accept(QOMTreeVisitor visitor, Object data) throws Exception {
+        return visitor.visit(this, data);
     }
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/ColumnImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/ColumnImpl.java?rev=573622&r1=573621&r2=573622&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/ColumnImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/ColumnImpl.java Fri Sep  7 09:09:59 2007
@@ -127,7 +127,7 @@
      *
      * @param visitor the visitor.
      */
-    public void accept(QOMTreeVisitor visitor, Object data) {
-        visitor.visit(this, data);
+    public Object accept(QOMTreeVisitor visitor, Object data) throws Exception {
+        return visitor.visit(this, data);
     }
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/ComparisonImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/ComparisonImpl.java?rev=573622&r1=573621&r2=573622&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/ComparisonImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/ComparisonImpl.java Fri Sep  7 09:09:59 2007
@@ -94,7 +94,7 @@
      *
      * @param visitor the visitor.
      */
-    public void accept(QOMTreeVisitor visitor, Object data) {
-        visitor.visit(this, data);
+    public Object accept(QOMTreeVisitor visitor, Object data) throws Exception {
+        return visitor.visit(this, data);
     }
 }

Added: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/DefaultQOMTreeVisitor.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/DefaultQOMTreeVisitor.java?rev=573622&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/DefaultQOMTreeVisitor.java (added)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/DefaultQOMTreeVisitor.java Fri Sep  7 09:09:59 2007
@@ -0,0 +1,213 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.core.query.qom;
+
+/**
+ * <code>DefaultQOMTreeVisitor</code> default implementation of a {@link
+ * QOMTreeVisitor}.
+ */
+public class DefaultQOMTreeVisitor implements QOMTreeVisitor {
+
+    /**
+     * Does nothing and returns <code>data</code>.
+     */
+    public Object visit(AndImpl node, Object data) throws Exception {
+        return data;
+    }
+
+    /**
+     * Does nothing and returns <code>data</code>.
+     */
+    public Object visit(BindVariableValueImpl node, Object data) throws Exception {
+        return data;
+    }
+
+    /**
+     * Does nothing and returns <code>data</code>.
+     */
+    public Object visit(ChildNodeImpl node, Object data) throws Exception {
+        return data;
+    }
+
+    /**
+     * Does nothing and returns <code>data</code>.
+     */
+    public Object visit(ChildNodeJoinConditionImpl node, Object data) throws Exception {
+        return data;
+    }
+
+    /**
+     * Does nothing and returns <code>data</code>.
+     */
+    public Object visit(ColumnImpl node, Object data) throws Exception {
+        return data;
+    }
+
+    /**
+     * Does nothing and returns <code>data</code>.
+     */
+    public Object visit(ComparisonImpl node, Object data) throws Exception {
+        return data;
+    }
+
+    /**
+     * Does nothing and returns <code>data</code>.
+     */
+    public Object visit(DescendantNodeImpl node, Object data) throws Exception {
+        return data;
+    }
+
+    /**
+     * Does nothing and returns <code>data</code>.
+     */
+    public Object visit(DescendantNodeJoinConditionImpl node, Object data) throws Exception {
+        return data;
+    }
+
+    /**
+     * Does nothing and returns <code>data</code>.
+     */
+    public Object visit(EquiJoinConditionImpl node, Object data) throws Exception {
+        return data;
+    }
+
+    /**
+     * Does nothing and returns <code>data</code>.
+     */
+    public Object visit(FullTextSearchImpl node, Object data) throws Exception {
+        return data;
+    }
+
+    /**
+     * Does nothing and returns <code>data</code>.
+     */
+    public Object visit(FullTextSearchScoreImpl node, Object data) throws Exception {
+        return data;
+    }
+
+    /**
+     * Does nothing and returns <code>data</code>.
+     */
+    public Object visit(JoinImpl node, Object data) throws Exception {
+        return data;
+    }
+
+    /**
+     * Does nothing and returns <code>data</code>.
+     */
+    public Object visit(LengthImpl node, Object data) throws Exception {
+        return data;
+    }
+
+    /**
+     * Does nothing and returns <code>data</code>.
+     */
+    public Object visit(LiteralImpl node, Object data) throws Exception {
+        return data;
+    }
+
+    /**
+     * Does nothing and returns <code>data</code>.
+     */
+    public Object visit(LowerCaseImpl node, Object data) throws Exception {
+        return data;
+    }
+
+    /**
+     * Does nothing and returns <code>data</code>.
+     */
+    public Object visit(NodeLocalNameImpl node, Object data) throws Exception {
+        return data;
+    }
+
+    /**
+     * Does nothing and returns <code>data</code>.
+     */
+    public Object visit(NodeNameImpl node, Object data) throws Exception {
+        return data;
+    }
+
+    /**
+     * Does nothing and returns <code>data</code>.
+     */
+    public Object visit(NotImpl node, Object data) throws Exception {
+        return data;
+    }
+
+    /**
+     * Does nothing and returns <code>data</code>.
+     */
+    public Object visit(OrderingImpl node, Object data) throws Exception {
+        return data;
+    }
+
+    /**
+     * Does nothing and returns <code>data</code>.
+     */
+    public Object visit(OrImpl node, Object data) throws Exception {
+        return data;
+    }
+
+    /**
+     * Does nothing and returns <code>data</code>.
+     */
+    public Object visit(PropertyExistenceImpl node, Object data) throws Exception {
+        return data;
+    }
+
+    /**
+     * Does nothing and returns <code>data</code>.
+     */
+    public Object visit(PropertyValueImpl node, Object data) throws Exception {
+        return data;
+    }
+
+    /**
+     * Does nothing and returns <code>data</code>.
+     */
+    public Object visit(QueryObjectModelTree node, Object data) throws Exception {
+        return data;
+    }
+
+    /**
+     * Does nothing and returns <code>data</code>.
+     */
+    public Object visit(SameNodeImpl node, Object data) throws Exception {
+        return data;
+    }
+
+    /**
+     * Does nothing and returns <code>data</code>.
+     */
+    public Object visit(SameNodeJoinConditionImpl node, Object data) throws Exception {
+        return data;
+    }
+
+    /**
+     * Does nothing and returns <code>data</code>.
+     */
+    public Object visit(SelectorImpl node, Object data) throws Exception {
+        return data;
+    }
+
+    /**
+     * Does nothing and returns <code>data</code>.
+     */
+    public Object visit(UpperCaseImpl node, Object data) throws Exception {
+        return data;
+    }
+}

Propchange: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/DefaultQOMTreeVisitor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/DefaultTraversingQOMTreeVisitor.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/DefaultTraversingQOMTreeVisitor.java?rev=573622&r1=573621&r2=573622&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/DefaultTraversingQOMTreeVisitor.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/DefaultTraversingQOMTreeVisitor.java Fri Sep  7 09:09:59 2007
@@ -17,194 +17,81 @@
 package org.apache.jackrabbit.core.query.qom;
 
 /**
- * <code>DefaultTraversingQOMTreeVisitor</code>...
+ * <code>DefaultTraversingQOMTreeVisitor</code> default implementation of a
+ * traversing {@link QOMTreeVisitor}.
  */
-public class DefaultTraversingQOMTreeVisitor implements QOMTreeVisitor {
+public class DefaultTraversingQOMTreeVisitor extends DefaultQOMTreeVisitor {
 
     /**
-     * {@inheritDoc}
-     * <p/>
      * Calls accept on each of the attached constraints of the AND node.
      */
-    public final void visit(AndImpl node, Object data) {
+    public final Object visit(AndImpl node, Object data) throws Exception {
         ((ConstraintImpl) node.getConstraint1()).accept(this, data);
         ((ConstraintImpl) node.getConstraint2()).accept(this, data);
+        return data;
     }
 
     /**
-     * {@inheritDoc}
-     * <p/>
-     * Does nothing.
-     */
-    public void visit(BindVariableValueImpl node, Object data) {
-    }
-
-    /**
-     * {@inheritDoc}
-     * <p/>
-     * Does nothing.
-     */
-    public void visit(ChildNodeImpl node, Object data) {
-    }
-
-    /**
-     * {@inheritDoc}
-     * <p/>
-     * Does nothing.
-     */
-    public void visit(ChildNodeJoinConditionImpl node, Object data) {
-    }
-
-    /**
-     * {@inheritDoc}
-     * <p/>
-     * Does nothing.
-     */
-    public void visit(ColumnImpl node, Object data) {
-    }
-
-    /**
-     * {@inheritDoc}
-     * <p/>
      * Calls accept on the two operands in the comparison node.
      */
-    public void visit(ComparisonImpl node, Object data) {
+    public Object visit(ComparisonImpl node, Object data) throws Exception {
         ((DynamicOperandImpl) node.getOperand1()).accept(this, data);
         ((StaticOperandImpl) node.getOperand2()).accept(this, data);
+        return data;
     }
 
     /**
-     * {@inheritDoc}
-     * <p/>
-     * Does nothing.
-     */
-    public void visit(DescendantNodeImpl node, Object data) {
-    }
-
-    /**
-     * {@inheritDoc}
-     * <p/>
-     * Does nothing.
-     */
-    public void visit(DescendantNodeJoinConditionImpl node, Object data) {
-    }
-
-    /**
-     * {@inheritDoc}
-     * <p/>
-     * Does nothing.
-     */
-    public void visit(EquiJoinConditionImpl node, Object data) {
-    }
-
-    /**
-     * {@inheritDoc}
-     * <p/>
-     * Does nothing.
-     */
-    public void visit(FullTextSearchImpl node, Object data) {
-    }
-
-    /**
-     * {@inheritDoc}
-     * <p/>
-     * Does nothing.
-     */
-    public void visit(FullTextSearchScoreImpl node, Object data) {
-    }
-
-    /**
-     * {@inheritDoc}
-     * <p/>
      * Calls accept on the two sources and the join condition in the join node.
      */
-    public void visit(JoinImpl node, Object data) {
+    public Object visit(JoinImpl node, Object data) throws Exception {
         ((SourceImpl) node.getRight()).accept(this, data);
         ((SourceImpl) node.getLeft()).accept(this, data);
         ((JoinConditionImpl) node.getJoinCondition()).accept(this, data);
+        return data;
     }
 
     /**
-     * {@inheritDoc}
-     * <p/>
      * Calls accept on the property value in the length node.
      */
-    public void visit(LengthImpl node, Object data) {
+    public Object visit(LengthImpl node, Object data) throws Exception {
         ((PropertyValueImpl) node.getPropertyValue()).accept(this, data);
+        return data;
     }
 
     /**
-     * {@inheritDoc}
-     * <p/>
      * Calls accept on the dynamic operand in the lower-case node.
      */
-    public void visit(LowerCaseImpl node, Object data) {
+    public Object visit(LowerCaseImpl node, Object data) throws Exception {
         ((DynamicOperandImpl) node.getOperand()).accept(this, data);
+        return data;
     }
 
     /**
-     * {@inheritDoc}
-     * <p/>
-     * Does nothing.
-     */
-    public void visit(NodeLocalNameImpl node, Object data) {
-    }
-
-    /**
-     * {@inheritDoc}
-     * <p/>
-     * Does nothing.
-     */
-    public void visit(NodeNameImpl node, Object data) {
-    }
-
-    /**
-     * {@inheritDoc}
-     * <p/>
      * Calls accept on the constraint in the NOT node.
      */
-    public void visit(NotImpl node, Object data) {
+    public Object visit(NotImpl node, Object data) throws Exception {
         ((ConstraintImpl) node.getConstraint()).accept(this, data);
+        return data;
     }
 
     /**
-     * {@inheritDoc}
-     * <p/>
      * Calls accept on the dynamic operand in the ordering node.
      */
-    public void visit(OrderingImpl node, Object data) {
+    public Object visit(OrderingImpl node, Object data) throws Exception {
         ((DynamicOperandImpl) node.getOperand()).accept(this, data);
+        return data;
     }
 
     /**
-     * {@inheritDoc}
-     * <p/>
      * Calls accept on each of the attached constraints of the OR node.
      */
-    public final void visit(OrImpl node, Object data) {
+    public Object visit(OrImpl node, Object data) throws Exception {
         ((ConstraintImpl) node.getConstraint1()).accept(this, data);
         ((ConstraintImpl) node.getConstraint2()).accept(this, data);
+        return data;
     }
 
     /**
-     * {@inheritDoc}
-     * <p/>
-     * Does nothing.
-     */
-    public void visit(PropertyExistenceImpl node, Object data) {
-    }
-
-    /**
-     * {@inheritDoc}
-     * <p/>
-     * Does nothing.
-     */
-    public void visit(PropertyValueImpl node, Object data) {
-    }
-
-    /**
-     * {@inheritDoc}
-     * <p/>
      * Calls accept on the following contained QOM nodes:
      * <ul>
      * <li>Source</li>
@@ -213,7 +100,7 @@
      * <li>Columns</li>
      * </ul>
      */
-    public void visit(QueryObjectModelTree node, Object data) {
+    public Object visit(QueryObjectModelTree node, Object data) throws Exception {
         node.getSource().accept(this, data);
         ConstraintImpl constraint = node.getConstraint();
         if (constraint != null) {
@@ -227,38 +114,14 @@
         for (int i = 0; i < columns.length; i++) {
             columns[i].accept(this, data);
         }
+        return data;
     }
 
     /**
-     * {@inheritDoc}
-     * <p/>
-     * Does nothing.
-     */
-    public void visit(SameNodeImpl node, Object data) {
-    }
-
-    /**
-     * {@inheritDoc}
-     * <p/>
-     * Does nothing.
-     */
-    public void visit(SameNodeJoinConditionImpl node, Object data) {
-    }
-
-    /**
-     * {@inheritDoc}
-     * <p/>
-     * Does nothing.
-     */
-    public void visit(SelectorImpl node, Object data) {
-    }
-
-    /**
-     * {@inheritDoc}
-     * <p/>
      * Calls accept on the dynamic operand in the lower-case node.
      */
-    public void visit(UpperCaseImpl node, Object data) {
+    public Object visit(UpperCaseImpl node, Object data) throws Exception {
         ((DynamicOperandImpl) node.getOperand()).accept(this, data);
+        return data;
     }
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/DescendantNodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/DescendantNodeImpl.java?rev=573622&r1=573621&r2=573622&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/DescendantNodeImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/DescendantNodeImpl.java Fri Sep  7 09:09:59 2007
@@ -73,7 +73,7 @@
      *
      * @param visitor the visitor.
      */
-    public void accept(QOMTreeVisitor visitor, Object data) {
-        visitor.visit(this, data);
+    public Object accept(QOMTreeVisitor visitor, Object data) throws Exception {
+        return visitor.visit(this, data);
     }
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/DescendantNodeJoinConditionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/DescendantNodeJoinConditionImpl.java?rev=573622&r1=573621&r2=573622&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/DescendantNodeJoinConditionImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/DescendantNodeJoinConditionImpl.java Fri Sep  7 09:09:59 2007
@@ -72,7 +72,7 @@
      *
      * @param visitor the visitor.
      */
-    public void accept(QOMTreeVisitor visitor, Object data) {
-        visitor.visit(this, data);
+    public Object accept(QOMTreeVisitor visitor, Object data) throws Exception {
+        return visitor.visit(this, data);
     }
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/EquiJoinConditionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/EquiJoinConditionImpl.java?rev=573622&r1=573621&r2=573622&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/EquiJoinConditionImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/EquiJoinConditionImpl.java Fri Sep  7 09:09:59 2007
@@ -104,7 +104,7 @@
      *
      * @param visitor the visitor.
      */
-    public void accept(QOMTreeVisitor visitor, Object data) {
-        visitor.visit(this, data);
+    public Object accept(QOMTreeVisitor visitor, Object data) throws Exception {
+        return visitor.visit(this, data);
     }
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/FullTextSearchImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/FullTextSearchImpl.java?rev=573622&r1=573621&r2=573622&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/FullTextSearchImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/FullTextSearchImpl.java Fri Sep  7 09:09:59 2007
@@ -58,6 +58,28 @@
      *
      * @return the selector name; non-null
      */
+    public QName getSelectorQName() {
+        return selectorName;
+    }
+
+    /**
+     * Gets the name of the property.
+     *
+     * @return the property name if the full-text search scope is a property,
+     *         otherwise null if the full-text search scope is the node (or node
+     *         subtree, in some implementations).
+     */
+    public QName getPropertyQName() {
+        return propertyName;
+    }
+
+    //--------------------------< FullTextSearch >------------------------------
+
+    /**
+     * Gets the name of the selector against which to apply this constraint.
+     *
+     * @return the selector name; non-null
+     */
     public String getSelectorName() {
         return getJCRName(selectorName);
     }
@@ -90,7 +112,7 @@
      *
      * @param visitor the visitor.
      */
-    public void accept(QOMTreeVisitor visitor, Object data) {
-        visitor.visit(this, data);
+    public Object accept(QOMTreeVisitor visitor, Object data) throws Exception {
+        return visitor.visit(this, data);
     }
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/FullTextSearchScoreImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/FullTextSearchScoreImpl.java?rev=573622&r1=573621&r2=573622&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/FullTextSearchScoreImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/FullTextSearchScoreImpl.java Fri Sep  7 09:09:59 2007
@@ -55,7 +55,7 @@
      *
      * @param visitor the visitor.
      */
-    public void accept(QOMTreeVisitor visitor, Object data) {
-        visitor.visit(this, data);
+    public Object accept(QOMTreeVisitor visitor, Object data) throws Exception {
+        return visitor.visit(this, data);
     }
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/JoinImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/JoinImpl.java?rev=573622&r1=573621&r2=573622&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/JoinImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/JoinImpl.java Fri Sep  7 09:09:59 2007
@@ -106,7 +106,7 @@
      *
      * @param visitor the visitor.
      */
-    public void accept(QOMTreeVisitor visitor, Object data) {
-        visitor.visit(this, data);
+    public Object accept(QOMTreeVisitor visitor, Object data) throws Exception {
+        return visitor.visit(this, data);
     }
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/LengthImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/LengthImpl.java?rev=573622&r1=573621&r2=573622&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/LengthImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/LengthImpl.java Fri Sep  7 09:09:59 2007
@@ -53,7 +53,7 @@
      *
      * @param visitor the visitor.
      */
-    public void accept(QOMTreeVisitor visitor, Object data) {
-        visitor.visit(this, data);
+    public Object accept(QOMTreeVisitor visitor, Object data) throws Exception {
+        return visitor.visit(this, data);
     }
 }

Added: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/LiteralImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/LiteralImpl.java?rev=573622&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/LiteralImpl.java (added)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/LiteralImpl.java Fri Sep  7 09:09:59 2007
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.core.query.qom;
+
+import org.apache.jackrabbit.core.query.jsr283.qom.Literal;
+import org.apache.jackrabbit.name.NamePathResolver;
+
+import javax.jcr.Value;
+
+/**
+ * <code>LiteralImpl</code>...
+ */
+public class LiteralImpl extends StaticOperandImpl implements Literal {
+
+    private final Value value;
+
+    public LiteralImpl(NamePathResolver resolver, Value value) {
+        super(resolver);
+        this.value = value;
+    }
+
+    /**
+     * @return the value of this literal.
+     */
+    public Value getValue() {
+        return value;
+    }
+
+    //------------------------< AbstractQOMNode >-------------------------------
+
+    /**
+     * Accepts a <code>visitor</code> and calls the appropriate visit method
+     * depending on the type of this QOM node.
+     *
+     * @param visitor the visitor.
+     */
+    public Object accept(QOMTreeVisitor visitor, Object data) throws Exception {
+        return visitor.visit(this, data);
+    }
+}

Propchange: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/LiteralImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/LowerCaseImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/LowerCaseImpl.java?rev=573622&r1=573621&r2=573622&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/LowerCaseImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/LowerCaseImpl.java Fri Sep  7 09:09:59 2007
@@ -53,7 +53,7 @@
      *
      * @param visitor the visitor.
      */
-    public void accept(QOMTreeVisitor visitor, Object data) {
-        visitor.visit(this, data);
+    public Object accept(QOMTreeVisitor visitor, Object data) throws Exception {
+        return visitor.visit(this, data);
     }
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/NodeLocalNameImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/NodeLocalNameImpl.java?rev=573622&r1=573621&r2=573622&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/NodeLocalNameImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/NodeLocalNameImpl.java Fri Sep  7 09:09:59 2007
@@ -55,7 +55,7 @@
      *
      * @param visitor the visitor.
      */
-    public void accept(QOMTreeVisitor visitor, Object data) {
-        visitor.visit(this, data);
+    public Object accept(QOMTreeVisitor visitor, Object data) throws Exception {
+        return visitor.visit(this, data);
     }
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/NodeNameImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/NodeNameImpl.java?rev=573622&r1=573621&r2=573622&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/NodeNameImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/NodeNameImpl.java Fri Sep  7 09:09:59 2007
@@ -53,7 +53,7 @@
      *
      * @param visitor the visitor.
      */
-    public void accept(QOMTreeVisitor visitor, Object data) {
-        visitor.visit(this, data);
+    public Object accept(QOMTreeVisitor visitor, Object data) throws Exception {
+        return visitor.visit(this, data);
     }
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/NotImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/NotImpl.java?rev=573622&r1=573621&r2=573622&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/NotImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/NotImpl.java Fri Sep  7 09:09:59 2007
@@ -53,7 +53,7 @@
      *
      * @param visitor the visitor.
      */
-    public void accept(QOMTreeVisitor visitor, Object data) {
-        visitor.visit(this, data);
+    public Object accept(QOMTreeVisitor visitor, Object data) throws Exception {
+        return visitor.visit(this, data);
     }
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/OrImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/OrImpl.java?rev=573622&r1=573621&r2=573622&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/OrImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/OrImpl.java Fri Sep  7 09:09:59 2007
@@ -68,7 +68,7 @@
      *
      * @param visitor the visitor.
      */
-    public void accept(QOMTreeVisitor visitor, Object data) {
-        visitor.visit(this, data);
+    public Object accept(QOMTreeVisitor visitor, Object data) throws Exception {
+        return visitor.visit(this, data);
     }
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/OrderingImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/OrderingImpl.java?rev=573622&r1=573621&r2=573622&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/OrderingImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/OrderingImpl.java Fri Sep  7 09:09:59 2007
@@ -78,7 +78,7 @@
      *
      * @param visitor the visitor.
      */
-    public void accept(QOMTreeVisitor visitor, Object data) {
-        visitor.visit(this, data);
+    public Object accept(QOMTreeVisitor visitor, Object data) throws Exception {
+        return visitor.visit(this, data);
     }
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/PropertyExistenceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/PropertyExistenceImpl.java?rev=573622&r1=573621&r2=573622&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/PropertyExistenceImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/PropertyExistenceImpl.java Fri Sep  7 09:09:59 2007
@@ -51,6 +51,26 @@
      *
      * @return the selector name; non-null
      */
+    public QName getSelectorQName() {
+        return selectorName;
+    }
+
+    /**
+     * Gets the name of the property.
+     *
+     * @return the property name; non-null
+     */
+    public QName getPropertyQName() {
+        return propertyName;
+    }
+
+    //------------------------------< PropertyExistence >-----------------------
+
+    /**
+     * Gets the name of the selector against which to apply this constraint.
+     *
+     * @return the selector name; non-null
+     */
     public String getSelectorName() {
         return getJCRName(selectorName);
     }
@@ -72,7 +92,7 @@
      *
      * @param visitor the visitor.
      */
-    public void accept(QOMTreeVisitor visitor, Object data) {
-        visitor.visit(this, data);
+    public Object accept(QOMTreeVisitor visitor, Object data) throws Exception {
+        return visitor.visit(this, data);
     }
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/PropertyValueImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/PropertyValueImpl.java?rev=573622&r1=573621&r2=573622&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/PropertyValueImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/qom/PropertyValueImpl.java Fri Sep  7 09:09:59 2007
@@ -51,6 +51,26 @@
      *
      * @return the selector name; non-null
      */
+    public QName getSelectorQName() {
+        return selectorName;
+    }
+
+    /**
+     * Gets the name of the property.
+     *
+     * @return the property name; non-null
+     */
+    public QName getPropertyQName() {
+        return propertyName;
+    }
+
+    //------------------------------< PropertyValue >---------------------------
+
+    /**
+     * Gets the name of the selector against which to evaluate this operand.
+     *
+     * @return the selector name; non-null
+     */
     public String getSelectorName() {
         return getJCRName(selectorName);
     }
@@ -72,7 +92,7 @@
      *
      * @param visitor the visitor.
      */
-    public void accept(QOMTreeVisitor visitor, Object data) {
-        visitor.visit(this, data);
+    public Object accept(QOMTreeVisitor visitor, Object data) throws Exception {
+        return visitor.visit(this, data);
     }
 }



Mime
View raw message