You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by md...@apache.org on 2011/09/07 14:00:20 UTC
svn commit: r1166138 [9/12] - in /jackrabbit/sandbox/jackrabbit-mk:
jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/
jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/batch/
jackrabbit-spi-commons/src/main/ja...
Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/PathQueryNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/PathQueryNode.java?rev=1166138&r1=1166137&r2=1166138&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/PathQueryNode.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/PathQueryNode.java Wed Sep 7 12:00:14 2011
@@ -16,13 +16,12 @@
*/
package org.apache.jackrabbit.spi.commons.query;
-import java.util.Collection;
-
-import javax.jcr.RepositoryException;
-
import org.apache.jackrabbit.spi.Name;
import org.apache.jackrabbit.spi.commons.name.NameConstants;
+import javax.jcr.RepositoryException;
+import java.util.Collection;
+
/**
* Implements a query node that defines a path restriction.
*/
@@ -31,7 +30,7 @@ public class PathQueryNode extends NAryQ
/**
* Flag indicating whether this path is absolute.
*/
- private boolean absolute = false;
+ private boolean absolute;
/**
* Valid node type names under /jcr:system. Used to determine if a
@@ -45,7 +44,7 @@ public class PathQueryNode extends NAryQ
private static final LocationStepQueryNode[] EMPTY = new LocationStepQueryNode[0];
/**
- * Creates a relative <code>PathQueryNode</code> with no location steps and
+ * Creates a relative {@code PathQueryNode} with no location steps and
* the collection of node types under /jcr:system.
*
* @param parent the parent query node.
@@ -66,10 +65,7 @@ public class PathQueryNode extends NAryQ
return validJcrSystemNodeTypeNames;
}
- /**
- * {@inheritDoc}
- * @throws RepositoryException
- */
+ @Override
public Object accept(QueryNodeVisitor visitor, Object data) throws RepositoryException {
return visitor.visit(this, data);
}
@@ -79,12 +75,13 @@ public class PathQueryNode extends NAryQ
*
* @return the type of this node.
*/
+ @Override
public int getType() {
return QueryNode.TYPE_PATH;
}
/**
- * Adds a path step to this <code>PathQueryNode</code>.
+ * Adds a path step to this {@code PathQueryNode}.
*
* @param step the step to add.
*/
@@ -106,9 +103,9 @@ public class PathQueryNode extends NAryQ
}
/**
- * If <code>absolute</code> is <code>true</code> sets this
- * <code>PathQueryNode</code> to an absolute path. If <code>absolute</code>
- * is <code>false</code> this path is considered relative.
+ * If {@code absolute} is {@code true} sets this
+ * {@code PathQueryNode} to an absolute path. If {@code absolute}
+ * is {@code false} this path is considered relative.
*
* @param absolute sets the absolute property to this new value.
*/
@@ -117,10 +114,10 @@ public class PathQueryNode extends NAryQ
}
/**
- * Returns <code>true</code> if this is an absolute path; <code>false</code>
+ * Returns {@code true} if this is an absolute path; {@code false}
* otherwise.
*
- * @return <code>true</code> if this is an absolute path; <code>false</code>
+ * @return {@code true} if this is an absolute path; {@code false}
* otherwise.
*/
public boolean isAbsolute() {
@@ -139,9 +136,7 @@ public class PathQueryNode extends NAryQ
}
- /**
- * {@inheritDoc}
- */
+ @Override
public boolean needsSystemTree() {
LocationStepQueryNode[] pathSteps = getPathSteps();
@@ -185,11 +180,8 @@ public class PathQueryNode extends NAryQ
// If the first workspace relative location step is jcr:system we need
// to include the system tree
Name firstWorkspaceRelativeName = firstWorkspaceRelativeStep.getNameTest();
- if (firstWorkspaceRelativeName == null
- || firstWorkspaceRelativeName.equals(NameConstants.JCR_SYSTEM)) {
- return true;
- }
+ return firstWorkspaceRelativeName == null || firstWorkspaceRelativeName.equals(NameConstants.JCR_SYSTEM)
+ || super.needsSystemTree();
- return super.needsSystemTree();
}
}
Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/PropertyFunctionQueryNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/PropertyFunctionQueryNode.java?rev=1166138&r1=1166137&r2=1166138&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/PropertyFunctionQueryNode.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/PropertyFunctionQueryNode.java Wed Sep 7 12:00:14 2011
@@ -16,18 +16,17 @@
*/
package org.apache.jackrabbit.spi.commons.query;
+import javax.jcr.RepositoryException;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
-import javax.jcr.RepositoryException;
-
/**
- * <code>PropertyFunctionQueryNode</code> allows to place function calls on properties
+ * {@code PropertyFunctionQueryNode} allows to place function calls on properties
* in a query. Supported function names are:
* <ul>
- * <li><code>upper-case</code> as specified in <a href="http://www.w3.org/TR/xquery-operators/#func-upper-case">fn:upper-case()</a></li>
- * <li><code>lower-case</code> as specified in <a href="http://www.w3.org/TR/xquery-operators/#func-lower-case">fn:lower-case()</a></li>
+ * <li>{@code upper-case} as specified in <a href="http://www.w3.org/TR/xquery-operators/#func-upper-case">fn:upper-case()</a></li>
+ * <li>{@code lower-case} as specified in <a href="http://www.w3.org/TR/xquery-operators/#func-lower-case">fn:lower-case()</a></li>
* </ul>
*/
public class PropertyFunctionQueryNode extends QueryNode {
@@ -64,12 +63,12 @@ public class PropertyFunctionQueryNode e
/**
* Creates a property function query node. This query node describes a
* function which is applied to a property parameter of the
- * <code>parent</code> query node.
+ * {@code parent} query node.
*
* @param parent the query node where this function is applied to.
* @param functionName the name of the function which is applied to
- * <code>parent</code>.
- * @throws IllegalArgumentException if <code>functionName</code> is not a
+ * {@code parent}.
+ * @throws IllegalArgumentException if {@code functionName} is not a
* supported function.
*/
protected PropertyFunctionQueryNode(QueryNode parent, String functionName)
@@ -81,10 +80,7 @@ public class PropertyFunctionQueryNode e
this.functionName = functionName;
}
- /**
- * {@inheritDoc}
- * @throws RepositoryException
- */
+ @Override
public Object accept(QueryNodeVisitor visitor, Object data) throws RepositoryException {
return visitor.visit(this, data);
}
@@ -94,13 +90,11 @@ public class PropertyFunctionQueryNode e
*
* @return the type of this node.
*/
+ @Override
public int getType() {
return QueryNode.TYPE_PROP_FUNCTION;
}
- /**
- * {@inheritDoc}
- */
public boolean equals(Object obj) {
if (obj instanceof PropertyFunctionQueryNode) {
PropertyFunctionQueryNode other = (PropertyFunctionQueryNode) obj;
@@ -116,9 +110,7 @@ public class PropertyFunctionQueryNode e
return functionName;
}
- /**
- * {@inheritDoc}
- */
+ @Override
public boolean needsSystemTree() {
return false;
}
Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryConstants.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryConstants.java?rev=1166138&r1=1166137&r2=1166138&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryConstants.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryConstants.java Wed Sep 7 12:00:14 2011
@@ -34,7 +34,7 @@ public interface QueryConstants {
/**
* Name of long data type
*/
- final String TYPE_NAME_LONG = "LONG";
+ String TYPE_NAME_LONG = "LONG";
/**
* double data type
@@ -44,7 +44,7 @@ public interface QueryConstants {
/**
* Name of double data type
*/
- final String TYPE_NAME_DOUBLE = "DOUBLE";
+ String TYPE_NAME_DOUBLE = "DOUBLE";
/**
* string data type
@@ -54,7 +54,7 @@ public interface QueryConstants {
/**
* Name of string data type
*/
- final String TYPE_NAME_STRING = "STRING";
+ String TYPE_NAME_STRING = "STRING";
/**
* date data type
@@ -64,7 +64,7 @@ public interface QueryConstants {
/**
* Name of date data type
*/
- final String TYPE_NAME_DATE = "DATE";
+ String TYPE_NAME_DATE = "DATE";
/**
* timestamp data type
@@ -74,7 +74,7 @@ public interface QueryConstants {
/**
* Name of timestamp data type
*/
- final String TYPE_NAME_TIMESTAMP = "TIMESTAMP";
+ String TYPE_NAME_TIMESTAMP = "TIMESTAMP";
/**
* position index type
@@ -84,12 +84,12 @@ public interface QueryConstants {
/**
* Name of position index
*/
- final String TYPE_NAME_POSITION = "POS";
+ String TYPE_NAME_POSITION = "POS";
/**
* Name for unknown data types
*/
- final String TYPE_NAME_UNKNOWN = "UNKNOWN TYPE";
+ String TYPE_NAME_UNKNOWN = "UNKNOWN TYPE";
int OPERATIONS = 10;
@@ -102,7 +102,7 @@ public interface QueryConstants {
/**
* Name of equal operation
*/
- final String OP_NAME_EQ_VALUE = "eq";
+ String OP_NAME_EQ_VALUE = "eq";
/**
* equal operation: =
@@ -113,7 +113,7 @@ public interface QueryConstants {
/**
* Name of equal operation (general comparison)
*/
- final String OP_NAME_EQ_GENERAL = "=";
+ String OP_NAME_EQ_GENERAL = "=";
/**
* not equal operation: ne
@@ -123,7 +123,7 @@ public interface QueryConstants {
/**
* Name of not equal operation
*/
- final String OP_NAME_NE_VALUE = "ne";
+ String OP_NAME_NE_VALUE = "ne";
/**
* not equal operation: <>
@@ -134,7 +134,7 @@ public interface QueryConstants {
/**
* Name of not equal operation (general comparison)
*/
- final String OP_NAME_NE_GENERAL = "<>";
+ String OP_NAME_NE_GENERAL = "<>";
/**
* less than operation: lt
@@ -144,7 +144,7 @@ public interface QueryConstants {
/**
* Name of less than operation
*/
- final String OP_NAME_LT_VALUE = "lt";
+ String OP_NAME_LT_VALUE = "lt";
/**
* less than operation: <
@@ -155,7 +155,7 @@ public interface QueryConstants {
/**
* Name of less than operation (general comparison)
*/
- final String OP_NAME_LT_GENERAL = "<";
+ String OP_NAME_LT_GENERAL = "<";
/**
* greater than operation: gt
@@ -165,7 +165,7 @@ public interface QueryConstants {
/**
* Name o^f greater than operation
*/
- final String OP_NAME_GT_VALUE = "gt";
+ String OP_NAME_GT_VALUE = "gt";
/**
* greater than operation: >
@@ -176,7 +176,7 @@ public interface QueryConstants {
/**
* Name of greater than operation (general comparison)
*/
- final String OP_NAME_GT_GENERAL = ">";
+ String OP_NAME_GT_GENERAL = ">";
/**
* greater or equal operation: ge
@@ -186,7 +186,7 @@ public interface QueryConstants {
/**
* Name of greater or equal operation
*/
- final String OP_NAME_GE_VALUE = "ge";
+ String OP_NAME_GE_VALUE = "ge";
/**
* greater or equal operation: >=
@@ -197,7 +197,7 @@ public interface QueryConstants {
/**
* Name of greater or equal operation (general comparison)
*/
- final String OP_NAME_GE_GENERAL = ">=";
+ String OP_NAME_GE_GENERAL = ">=";
/**
* less than or equal operation: le
@@ -207,7 +207,7 @@ public interface QueryConstants {
/**
* Name of less than or equal operation
*/
- final String OP_NAME_LE_VALUE = "le";
+ String OP_NAME_LE_VALUE = "le";
/**
* less than or equal operation: <=
@@ -218,7 +218,7 @@ public interface QueryConstants {
/**
* Name of less than or equal operation (general comparison)
*/
- final String OP_NAME_LE_GENERAL = "<=";
+ String OP_NAME_LE_GENERAL = "<=";
/**
* like operation: identifier LIKE string_literal
@@ -228,7 +228,7 @@ public interface QueryConstants {
/**
* Name of like operation
*/
- final String OP_NAME_LIKE = "LIKE";
+ String OP_NAME_LIKE = "LIKE";
/**
* between operation: identifier [ NOT ] BETWEEN literal AND literal
@@ -238,7 +238,7 @@ public interface QueryConstants {
/**
* Name of between operation
*/
- final String OP_NAME_BETWEEN = "BETWEEN";
+ String OP_NAME_BETWEEN = "BETWEEN";
/**
* in operation: identifier [ NOT ] IN ( literal {, literal}* )
@@ -248,7 +248,7 @@ public interface QueryConstants {
/**
* Name of in operation
*/
- final String OP_NAME_IN = "IN";
+ String OP_NAME_IN = "IN";
/**
* is null operation: identifier IS NULL
@@ -258,7 +258,7 @@ public interface QueryConstants {
/**
* Name of is null operation
*/
- final String OP_NAME_NULL = "IS NULL";
+ String OP_NAME_NULL = "IS NULL";
/**
* is not null operation: identifier IS NOT NULL
@@ -268,7 +268,7 @@ public interface QueryConstants {
/**
* Name of is not null operation
*/
- final String OP_NAME_NOT_NULL = "NOT NULL";
+ String OP_NAME_NOT_NULL = "NOT NULL";
/**
* similar operation:
@@ -280,7 +280,7 @@ public interface QueryConstants {
/**
* Name of similar operation
*/
- final String OP_NAME_SIMILAR = "similarity";
+ String OP_NAME_SIMILAR = "similarity";
/**
* spellcheck operation:
@@ -292,45 +292,46 @@ public interface QueryConstants {
/**
* Name of spellcheck operation
*/
- final String OP_NAME_SPELLCHECK = "spellcheck";
+ String OP_NAME_SPELLCHECK = "spellcheck";
/**
* Name of unknown operations
*/
- final String OP_NAME_UNKNOW = "UNKNOWN OPERATION";
+ String OP_NAME_UNKNOW = "UNKNOWN OPERATION";
/**
* Operation names
*/
- final ConstantNameProvider OPERATION_NAMES = new ConstantNameProvider() {
+ ConstantNameProvider OPERATION_NAMES = new ConstantNameProvider() {
private final Map operationNames;
{
Map map = new HashMap();
- map.put(new Integer(OPERATION_BETWEEN), OP_NAME_BETWEEN);
- map.put(new Integer(OPERATION_EQ_VALUE), OP_NAME_EQ_VALUE);
- map.put(new Integer(OPERATION_EQ_GENERAL), OP_NAME_EQ_GENERAL);
- map.put(new Integer(OPERATION_GE_GENERAL), OP_NAME_GE_GENERAL);
- map.put(new Integer(OPERATION_GE_VALUE), OP_NAME_GE_VALUE);
- map.put(new Integer(OPERATION_GT_GENERAL), OP_NAME_GT_GENERAL);
- map.put(new Integer(OPERATION_GT_VALUE), OP_NAME_GT_VALUE);
- map.put(new Integer(OPERATION_IN), OP_NAME_IN);
- map.put(new Integer(OPERATION_LE_GENERAL), OP_NAME_LE_GENERAL);
- map.put(new Integer(OPERATION_LE_VALUE), OP_NAME_LE_VALUE);
- map.put(new Integer(OPERATION_LIKE), OP_NAME_LIKE);
- map.put(new Integer(OPERATION_LT_GENERAL), OP_NAME_LT_GENERAL);
- map.put(new Integer(OPERATION_LT_VALUE), OP_NAME_LT_VALUE);
- map.put(new Integer(OPERATION_NE_GENERAL), OP_NAME_NE_GENERAL);
- map.put(new Integer(OPERATION_NE_VALUE), OP_NAME_NE_VALUE);
- map.put(new Integer(OPERATION_NOT_NULL), OP_NAME_NOT_NULL);
- map.put(new Integer(OPERATION_NULL), OP_NAME_NULL);
- map.put(new Integer(OPERATION_SIMILAR), OP_NAME_SIMILAR);
- map.put(new Integer(OPERATION_SPELLCHECK), OP_NAME_SPELLCHECK);
+ map.put(OPERATION_BETWEEN, OP_NAME_BETWEEN);
+ map.put(OPERATION_EQ_VALUE, OP_NAME_EQ_VALUE);
+ map.put(OPERATION_EQ_GENERAL, OP_NAME_EQ_GENERAL);
+ map.put(OPERATION_GE_GENERAL, OP_NAME_GE_GENERAL);
+ map.put(OPERATION_GE_VALUE, OP_NAME_GE_VALUE);
+ map.put(OPERATION_GT_GENERAL, OP_NAME_GT_GENERAL);
+ map.put(OPERATION_GT_VALUE, OP_NAME_GT_VALUE);
+ map.put(OPERATION_IN, OP_NAME_IN);
+ map.put(OPERATION_LE_GENERAL, OP_NAME_LE_GENERAL);
+ map.put(OPERATION_LE_VALUE, OP_NAME_LE_VALUE);
+ map.put(OPERATION_LIKE, OP_NAME_LIKE);
+ map.put(OPERATION_LT_GENERAL, OP_NAME_LT_GENERAL);
+ map.put(OPERATION_LT_VALUE, OP_NAME_LT_VALUE);
+ map.put(OPERATION_NE_GENERAL, OP_NAME_NE_GENERAL);
+ map.put(OPERATION_NE_VALUE, OP_NAME_NE_VALUE);
+ map.put(OPERATION_NOT_NULL, OP_NAME_NOT_NULL);
+ map.put(OPERATION_NULL, OP_NAME_NULL);
+ map.put(OPERATION_SIMILAR, OP_NAME_SIMILAR);
+ map.put(OPERATION_SPELLCHECK, OP_NAME_SPELLCHECK);
operationNames = Collections.unmodifiableMap(map);
}
+ @Override
public String getName(int constant) {
- String name = (String) operationNames.get(new Integer(constant));
+ String name = (String) operationNames.get(constant);
return name == null? OP_NAME_UNKNOW : name;
}
};
@@ -338,22 +339,23 @@ public interface QueryConstants {
/**
* Type names
*/
- final ConstantNameProvider TYPE_NAMES = new ConstantNameProvider() {
+ ConstantNameProvider TYPE_NAMES = new ConstantNameProvider() {
private final Map typeNames;
{
Map map = new HashMap();
- map.put(new Integer(TYPE_DATE), TYPE_NAME_DATE);
- map.put(new Integer(TYPE_DOUBLE), TYPE_NAME_DOUBLE);
- map.put(new Integer(TYPE_LONG), TYPE_NAME_LONG);
- map.put(new Integer(TYPE_POSITION), TYPE_NAME_POSITION);
- map.put(new Integer(TYPE_STRING), TYPE_NAME_STRING);
- map.put(new Integer(TYPE_TIMESTAMP), TYPE_NAME_TIMESTAMP);
+ map.put(TYPE_DATE, TYPE_NAME_DATE);
+ map.put(TYPE_DOUBLE, TYPE_NAME_DOUBLE);
+ map.put(TYPE_LONG, TYPE_NAME_LONG);
+ map.put(TYPE_POSITION, TYPE_NAME_POSITION);
+ map.put(TYPE_STRING, TYPE_NAME_STRING);
+ map.put(TYPE_TIMESTAMP, TYPE_NAME_TIMESTAMP);
typeNames = Collections.unmodifiableMap(map);
}
+ @Override
public String getName(int constant) {
- String name = (String) typeNames.get(new Integer(constant));
+ String name = (String) typeNames.get(constant);
return name == null? TYPE_NAME_UNKNOWN : name;
}
};
Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryNode.java?rev=1166138&r1=1166137&r2=1166138&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryNode.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryNode.java Wed Sep 7 12:00:14 2011
@@ -65,15 +65,15 @@ public abstract class QueryNode {
public static final int TYPE_PROP_FUNCTION = 13;
/**
- * References the parent of this <code>QueryNode</code>. If this is the root
- * of a query tree, then <code>parent</code> is <code>null</code>.
+ * References the parent of this {@code QueryNode}. If this is the root
+ * of a query tree, then {@code parent} is {@code null}.
*/
private final QueryNode parent;
/**
- * Constructs a new <code>QueryNode</code> with a reference to it's parent.
+ * Constructs a new {@code QueryNode} with a reference to it's parent.
*
- * @param parent the parent node, or <code>null</code> if this is the root
+ * @param parent the parent node, or {@code null} if this is the root
* node of a query tree.
*/
public QueryNode(QueryNode parent) {
@@ -81,10 +81,10 @@ public abstract class QueryNode {
}
/**
- * Returns the parent <code>QueryNode</code> or <code>null</code> if this is
+ * Returns the parent {@code QueryNode} or {@code null} if this is
* the root node of a query tree.
*
- * @return the parent <code>QueryNode</code> or <code>null</code> if this is
+ * @return the parent {@code QueryNode} or {@code null} if this is
* the root node of a query tree.
*/
public QueryNode getParent() {
@@ -103,13 +103,13 @@ public abstract class QueryNode {
}
/**
- * Accepts a {@link QueryNodeVisitor} and calls the apropriate <code>visit</code>
+ * Accepts a {@link QueryNodeVisitor} and calls the apropriate {@code visit}
* method on the visitor depending on the concrete implementation of
- * this <code>QueryNode</code>.
+ * this {@code QueryNode}.
*
* @param visitor the visitor to call back.
* @param data arbitrary data for the visitor.
- * @return the return value of the <code>visitor.visit()</code> call.
+ * @return the return value of the {@code visitor.visit()} call.
* @throws RepositoryException
*/
public abstract Object accept(QueryNodeVisitor visitor, Object data) throws RepositoryException;
@@ -121,21 +121,21 @@ public abstract class QueryNode {
public abstract int getType();
/**
- * Returns <code>true</code> if <code>obj</code> is the same type of
- * <code>QueryNode</code> as <code>this</code> node and is equal to
- * <code>this</code> node.
+ * Returns {@code true} if {@code obj} is the same type of
+ * {@code QueryNode} as {@code this} node and is equal to
+ * {@code this} node.
* @param obj the reference object with which to compare.
- * @return <code>true</code> if <code>obj</code> is equal to
- * <code>this</code>; <code>false</code> otherwise.
+ * @return {@code true} if {@code obj} is equal to
+ * {@code this}; {@code false} otherwise.
*/
public abstract boolean equals(Object obj);
/**
- * Returns <code>true</code> if this query node needs items under
+ * Returns {@code true} if this query node needs items under
* /jcr:system to be queried.
*
- * @return <code>true</code> if this query node needs content under
- * /jcr:system to be queried; <code>false</code> otherwise.
+ * @return {@code true} if this query node needs content under
+ * /jcr:system to be queried; {@code false} otherwise.
*/
public abstract boolean needsSystemTree();
}
Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryNodeVisitor.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryNodeVisitor.java?rev=1166138&r1=1166137&r2=1166138&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryNodeVisitor.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryNodeVisitor.java Wed Sep 7 12:00:14 2011
@@ -19,7 +19,7 @@ package org.apache.jackrabbit.spi.common
import javax.jcr.RepositoryException;
/**
- * Defines the interface for a <code>QueryNodeVisitor</code>.
+ * Defines the interface for a {@code QueryNodeVisitor}.
*/
public interface QueryNodeVisitor {
Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryParser.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryParser.java?rev=1166138&r1=1166137&r2=1166138&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryParser.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryParser.java Wed Sep 7 12:00:14 2011
@@ -17,10 +17,10 @@
package org.apache.jackrabbit.spi.commons.query;
-import javax.jcr.query.InvalidQueryException;
-
import org.apache.jackrabbit.spi.commons.conversion.NameResolver;
+import javax.jcr.query.InvalidQueryException;
+
/**
* This class acts as the central entry point for parsing query statements from
* different query syntaxes into a query tree.
@@ -34,10 +34,10 @@ public class QueryParser {
}
/**
- * Parses a query <code>statement</code> according to a query
- * <code>language</code> into a query tree.
+ * Parses a query {@code statement} according to a query
+ * {@code language} into a query tree.
* <p/>
- * <code>language</code> must be one of: {@link javax.jcr.query.Query#SQL},
+ * {@code language} must be one of: {@link javax.jcr.query.Query#SQL},
* {@link javax.jcr.query.Query#XPATH}.
*
* @param statement the query statement.
@@ -59,7 +59,7 @@ public class QueryParser {
/**
* Creates a String representation of the QueryNode tree argument
- * <code>root</code>. The argument <code>language</code> specifies the
+ * {@code root}. The argument {@code language} specifies the
* syntax.
* See also: {@link javax.jcr.query.QueryManager#getSupportedQueryLanguages()}.
*
@@ -73,7 +73,7 @@ public class QueryParser {
* @throws InvalidQueryException if the query node tree cannot be converted
* into a String representation of the given language. This might be due to
* syntax restrictions of the given language. This exception is also thrown
- * if <code>language</code> is not one of the supported query languages
+ * if {@code language} is not one of the supported query languages
* returned by the {@link javax.jcr.query.QueryManager}.
*/
public static String toString(QueryRootNode root,
Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryRootNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryRootNode.java?rev=1166138&r1=1166137&r2=1166138&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryRootNode.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryRootNode.java Wed Sep 7 12:00:14 2011
@@ -16,12 +16,11 @@
*/
package org.apache.jackrabbit.spi.commons.query;
-import java.util.ArrayList;
-import java.util.List;
+import org.apache.jackrabbit.spi.Name;
import javax.jcr.RepositoryException;
-
-import org.apache.jackrabbit.spi.Name;
+import java.util.ArrayList;
+import java.util.List;
/**
* Implements the root node of a query tree.
@@ -45,17 +44,17 @@ public class QueryRootNode extends Query
private OrderQueryNode orderNode;
/**
- * Creates a new <code>QueryRootNode</code> instance.
+ * Creates a new {@code QueryRootNode} instance.
*/
protected QueryRootNode() {
super(null);
}
/**
- * Returns the {@link PathQueryNode} or <code>null</code> if this query does
+ * Returns the {@link PathQueryNode} or {@code null} if this query does
* not have a location node.
*
- * @return the {@link PathQueryNode} or <code>null</code> if this query does
+ * @return the {@link PathQueryNode} or {@code null} if this query does
* not have a location node.
*/
public PathQueryNode getLocationNode() {
@@ -90,7 +89,7 @@ public class QueryRootNode extends Query
}
/**
- * Returns the order node or <code>null</code> if no order is specified.
+ * Returns the order node or {@code null} if no order is specified.
*
* @return the order node.
*/
@@ -107,10 +106,7 @@ public class QueryRootNode extends Query
this.orderNode = orderNode;
}
- /**
- * {@inheritDoc}
- * @throws RepositoryException
- */
+ @Override
public Object accept(QueryNodeVisitor visitor, Object data) throws RepositoryException {
return visitor.visit(this, data);
}
@@ -120,6 +116,7 @@ public class QueryRootNode extends Query
*
* @return the type of this node.
*/
+ @Override
public int getType() {
return QueryNode.TYPE_ROOT;
}
@@ -137,11 +134,9 @@ public class QueryRootNode extends Query
return false;
}
- /**
- * {@inheritDoc}
- */
+ @Override
public boolean needsSystemTree() {
- return (locationNode != null && locationNode.needsSystemTree()) || (orderNode != null && orderNode.needsSystemTree());
+ return locationNode != null && locationNode.needsSystemTree() || orderNode != null && orderNode.needsSystemTree();
}
}
Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryTreeBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryTreeBuilder.java?rev=1166138&r1=1166137&r2=1166138&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryTreeBuilder.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryTreeBuilder.java Wed Sep 7 12:00:14 2011
@@ -16,38 +16,36 @@
*/
package org.apache.jackrabbit.spi.commons.query;
-import javax.jcr.query.InvalidQueryException;
-
import org.apache.jackrabbit.spi.commons.conversion.NameResolver;
+import javax.jcr.query.InvalidQueryException;
+
/**
* Specifies an interface for a query tree builder.
*/
public interface QueryTreeBuilder {
/**
- * Creates a <code>QueryNode</code> tree from a statement using the passed
+ * Creates a {@code QueryNode} tree from a statement using the passed
* query node factory.
*
* @param statement the statement.
* @param resolver the name resolver to use.
* @param factory the query node factory to use.
- * @return the <code>QueryNode</code> tree for the statement.
+ * @return the {@code QueryNode} tree for the statement.
* @throws javax.jcr.query.InvalidQueryException
* if the statement is malformed.
*/
- QueryRootNode createQueryTree(String statement,
- NameResolver resolver,
- QueryNodeFactory factory)
+ QueryRootNode createQueryTree(String statement, NameResolver resolver, QueryNodeFactory factory)
throws InvalidQueryException;
/**
- * Returns <code>true</code> if this query tree builder can handle a
- * statement in <code>language</code>.
+ * Returns {@code true} if this query tree builder can handle a
+ * statement in {@code language}.
*
* @param language the language of a query statement to build a query tree.
- * @return <code>true</code> if this builder can handle <code>language</code>;
- * <code>false</code> otherwise.
+ * @return {@code true} if this builder can handle {@code language};
+ * {@code false} otherwise.
*/
boolean canHandle(String language);
@@ -60,7 +58,7 @@ public interface QueryTreeBuilder {
/**
* Creates a String representation of the query node tree in the syntax this
- * <code>QueryTreeBuilder</code> can handle.
+ * {@code QueryTreeBuilder} can handle.
*
* @param root the root of the query node tree.
* @param resolver to resolve Names.
@@ -69,7 +67,6 @@ public interface QueryTreeBuilder {
* into a String representation due to
* restrictions in this syntax.
*/
- String toString(QueryRootNode root, NameResolver resolver)
- throws InvalidQueryException;
+ String toString(QueryRootNode root, NameResolver resolver) throws InvalidQueryException;
}
Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryTreeBuilderRegistry.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryTreeBuilderRegistry.java?rev=1166138&r1=1166137&r2=1166138&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryTreeBuilderRegistry.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryTreeBuilderRegistry.java Wed Sep 7 12:00:14 2011
@@ -32,7 +32,7 @@ import java.util.Set;
/**
* Implements a central access to QueryTreeBuilder instances.
*/
-public class QueryTreeBuilderRegistry {
+public final class QueryTreeBuilderRegistry {
/**
* Logger instance for this class.
@@ -40,7 +40,7 @@ public class QueryTreeBuilderRegistry {
private static final Logger log = LoggerFactory.getLogger(QueryTreeBuilderRegistry.class);
/**
- * List of <code>QueryTreeBuilder</code> instances known to the classloader.
+ * List of {@code QueryTreeBuilder} instances known to the classloader.
*/
private static final List BUILDERS = new ArrayList();
@@ -49,6 +49,9 @@ public class QueryTreeBuilderRegistry {
*/
private static final Set LANGUAGES;
+ private QueryTreeBuilderRegistry() {
+ }
+
static {
Set languages = new HashSet();
try {
@@ -66,17 +69,17 @@ public class QueryTreeBuilderRegistry {
}
/**
- * Returns the <code>QueryTreeBuilder</code> for <code>language</code>.
+ * Returns the {@code QueryTreeBuilder} for {@code language}.
*
* @param language the language of the query statement.
- * @return the <code>QueryTreeBuilder</code> for <code>language</code>.
+ * @return the {@code QueryTreeBuilder} for {@code language}.
* @throws InvalidQueryException if there is no query tree builder for
- * <code>language</code>.
+ * {@code language}.
*/
public static QueryTreeBuilder getQueryTreeBuilder(String language)
throws InvalidQueryException {
- for (int i = 0; i < BUILDERS.size(); i++) {
- QueryTreeBuilder builder = (QueryTreeBuilder) BUILDERS.get(i);
+ for (Object BUILDER : BUILDERS) {
+ QueryTreeBuilder builder = (QueryTreeBuilder) BUILDER;
if (builder.canHandle(language)) {
return builder;
}
Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/RelationQueryNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/RelationQueryNode.java?rev=1166138&r1=1166137&r2=1166138&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/RelationQueryNode.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/RelationQueryNode.java Wed Sep 7 12:00:14 2011
@@ -16,14 +16,13 @@
*/
package org.apache.jackrabbit.spi.commons.query;
-import java.util.Date;
-
-import javax.jcr.RepositoryException;
-
import org.apache.jackrabbit.spi.Name;
import org.apache.jackrabbit.spi.Path;
import org.apache.jackrabbit.spi.Path.Element;
import org.apache.jackrabbit.spi.commons.name.NameFactoryImpl;
+
+import javax.jcr.RepositoryException;
+import java.util.Date;
/**
* Implements a query node that defines property value relation.
*/
@@ -39,40 +38,40 @@ public class RelationQueryNode extends N
/**
* The relative path to the property.
*/
- private PathQueryNode relPath;
+ private final PathQueryNode relPath;
/**
- * If <code>true</code> this relation query node contains a value preceded
+ * If {@code true} this relation query node contains a value preceded
* with an unary minus.
*/
private boolean unaryMinus;
/**
- * The <code>long</code> value of the relation if this is a query is of type
- * <code>long</code>
+ * The {@code long} value of the relation if this is a query is of type
+ * {@code long}
*/
private long valueLong;
/**
- * The <code>int</code> value of the position index.
+ * The {@code int} value of the position index.
*/
private int valuePosition;
/**
- * The <code>double</code> value of the relation if this is a query is of
- * type <code>double</code>
+ * The {@code double} value of the relation if this is a query is of
+ * type {@code double}
*/
private double valueDouble;
/**
- * The <code>String</code> value of the relation if this is a query is of
- * type <code>String</code>
+ * The {@code String} value of the relation if this is a query is of
+ * type {@code String}
*/
private String valueString;
/**
- * The <code>Date</code> value of the relation if this is a query is of type
- * <code>Date</code>
+ * The {@code Date} value of the relation if this is a query is of type
+ * {@code Date}
*/
private Date valueDate;
@@ -91,7 +90,7 @@ public class RelationQueryNode extends N
private final QueryNodeFactory factory;
/**
- * Creates a new <code>RelationQueryNode</code> without a type nor value
+ * Creates a new {@code RelationQueryNode} without a type nor value
* assigned.
*
* @param parent the parent node for this query node.
@@ -104,13 +103,10 @@ public class RelationQueryNode extends N
super(parent);
this.operation = operation;
this.factory = factory;
- this.relPath = factory.createPathQueryNode(this);
+ relPath = factory.createPathQueryNode(this);
}
- /**
- * {@inheritDoc}
- * @throws RepositoryException
- */
+ @Override
public Object accept(QueryNodeVisitor visitor, Object data) throws RepositoryException {
return visitor.visit(this, data);
}
@@ -120,15 +116,16 @@ public class RelationQueryNode extends N
*
* @return the type of this node.
*/
+ @Override
public int getType() {
return QueryNode.TYPE_RELATION;
}
/**
- * If <code>b</code> is <code>true</code> then the value in this relation
+ * If {@code b} is {@code true} then the value in this relation
* node contains a receding unary minus.
*
- * @param b <code>true</code> if this relation contains a unary minus.
+ * @param b {@code true} if this relation contains a unary minus.
*/
public void setUnaryMinus(boolean b) {
unaryMinus = b;
@@ -154,7 +151,7 @@ public class RelationQueryNode extends N
* Sets the relative path to the property in this relation.
*
* @param relPath the relative path to a property.
- * @throws IllegalArgumentException if <code>relPath</code> is absolute.
+ * @throws IllegalArgumentException if {@code relPath} is absolute.
*/
public void setRelativePath(Path relPath) {
if (relPath.isAbsolute()) {
@@ -184,17 +181,17 @@ public class RelationQueryNode extends N
}
/**
- * Returns the <code>long</code> value if this relation if of type
+ * Returns the {@code long} value if this relation if of type
* {@link #TYPE_LONG}.
*
- * @return the <code>long</code> value.
+ * @return the {@code long} value.
*/
public long getLongValue() {
return valueLong;
}
/**
- * Sets a new value of type <code>long</code>.
+ * Sets a new value of type {@code long}.
*
* @param value the new value.
*/
@@ -204,7 +201,7 @@ public class RelationQueryNode extends N
}
/**
- * Returns the <code>int</code> position index value if this relation is
+ * Returns the {@code int} position index value if this relation is
* of type {@link #TYPE_POSITION}.
* @return the position index value.
*/
@@ -223,17 +220,17 @@ public class RelationQueryNode extends N
}
/**
- * Returns the <code>double</code> value if this relation if of type
+ * Returns the {@code double} value if this relation if of type
* {@link #TYPE_DOUBLE}.
*
- * @return the <code>double</code> value.
+ * @return the {@code double} value.
*/
public double getDoubleValue() {
return valueDouble;
}
/**
- * Sets a new value of type <code>double</code>.
+ * Sets a new value of type {@code double}.
*
* @param value the new value.
*/
@@ -243,17 +240,17 @@ public class RelationQueryNode extends N
}
/**
- * Returns the <code>String</code> value if this relation if of type
+ * Returns the {@code String} value if this relation if of type
* {@link #TYPE_STRING}.
*
- * @return the <code>String</code> value.
+ * @return the {@code String} value.
*/
public String getStringValue() {
return valueString;
}
/**
- * Sets a new value of type <code>String</code>.
+ * Sets a new value of type {@code String}.
*
* @param value the new value.
*/
@@ -263,17 +260,17 @@ public class RelationQueryNode extends N
}
/**
- * Returns the <code>Date</code> value if this relation if of type
+ * Returns the {@code Date} value if this relation if of type
* {@link #TYPE_DATE}.
*
- * @return the <code>Date</code> value.
+ * @return the {@code Date} value.
*/
public Date getDateValue() {
return valueDate;
}
/**
- * Sets a new value of type <code>Date</code>.
+ * Sets a new value of type {@code Date}.
*
* @param value the new value.
*/
Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/TextsearchQueryNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/TextsearchQueryNode.java?rev=1166138&r1=1166137&r2=1166138&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/TextsearchQueryNode.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/TextsearchQueryNode.java Wed Sep 7 12:00:14 2011
@@ -16,13 +16,12 @@
*/
package org.apache.jackrabbit.spi.commons.query;
-import javax.jcr.RepositoryException;
-
-import org.apache.jackrabbit.spi.Name;
import org.apache.jackrabbit.spi.Path;
import org.apache.jackrabbit.spi.commons.conversion.MalformedPathException;
import org.apache.jackrabbit.spi.commons.name.PathBuilder;
+import javax.jcr.RepositoryException;
+
/**
* Implements a query node that defines a textsearch clause.
*/
@@ -36,20 +35,20 @@ public class TextsearchQueryNode extends
/**
* Limits the scope of this textsearch clause to a node or a property with
* the given relative path.
- * If <code>null</code> the scope of this textsearch clause is the fulltext
+ * If {@code null} the scope of this textsearch clause is the fulltext
* index of all properties of the context node.
*/
private Path relPath;
/**
- * If set to <code>true</code> {@link #relPath} references a property,
+ * If set to {@code true} {@link #relPath} references a property,
* otherwise references a node.
*/
private boolean propertyRef;
/**
- * Creates a new <code>TextsearchQueryNode</code> with a <code>parent</code>
- * and a textsearch <code>query</code> statement. The scope of the query
+ * Creates a new {@code TextsearchQueryNode} with a {@code parent}
+ * and a textsearch {@code query} statement. The scope of the query
* is the fulltext index of the node, that contains all properties.
*
* @param parent the parent node of this query node.
@@ -58,14 +57,11 @@ public class TextsearchQueryNode extends
protected TextsearchQueryNode(QueryNode parent, String query) {
super(parent);
this.query = query;
- this.relPath = null;
- this.propertyRef = false;
+ relPath = null;
+ propertyRef = false;
}
- /**
- * {@inheritDoc}
- * @throws RepositoryException
- */
+ @Override
public Object accept(QueryNodeVisitor visitor, Object data) throws RepositoryException {
return visitor.visit(this, data);
}
@@ -75,6 +71,7 @@ public class TextsearchQueryNode extends
*
* @return the type of this node.
*/
+ @Override
public int getType() {
return QueryNode.TYPE_TEXTSEARCH;
}
@@ -90,7 +87,7 @@ public class TextsearchQueryNode extends
/**
* @return the relative path that references the item where the textsearch
- * is performed. Returns <code>null</code> if the textsearch is
+ * is performed. Returns {@code null} if the textsearch is
* performed on the context node.
*/
public Path getRelativePath() {
@@ -99,11 +96,11 @@ public class TextsearchQueryNode extends
/**
* Sets the relative path to the item where the textsearch is performed. If
- * <code>relPath</code> is <code>null</code> the textsearch is performed on
+ * {@code relPath} is {@code null} the textsearch is performed on
* the context node.
*
* @param relPath the relative path to an item.
- * @throws IllegalArgumentException if <code>relPath</code> is absolute.
+ * @throws IllegalArgumentException if {@code relPath} is absolute.
*/
public void setRelativePath(Path relPath) {
if (relPath != null && relPath.isAbsolute()) {
@@ -136,16 +133,16 @@ public class TextsearchQueryNode extends
}
/**
- * @return <code>true</code> if {@link #getRelativePath()} references a
- * property, returns <code>false</code> if it references a node.
+ * @return {@code true} if {@link #getRelativePath()} references a
+ * property, returns {@code false} if it references a node.
*/
public boolean getReferencesProperty() {
return propertyRef;
}
/**
- * Is set to <code>true</code>, indicates that {@link #getRelativePath()}
- * references a property, if set to <code>false</code> indicates that it
+ * Is set to {@code true}, indicates that {@link #getRelativePath()}
+ * references a property, if set to {@code false} indicates that it
* references a node.
*
* @param b flag whether a property is referenced.
@@ -167,9 +164,7 @@ public class TextsearchQueryNode extends
return false;
}
- /**
- * {@inheritDoc}
- */
+ @Override
public boolean needsSystemTree() {
return false;
}
Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/TraversingQueryNodeVisitor.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/TraversingQueryNodeVisitor.java?rev=1166138&r1=1166137&r2=1166138&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/TraversingQueryNodeVisitor.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/TraversingQueryNodeVisitor.java Wed Sep 7 12:00:14 2011
@@ -19,19 +19,22 @@ package org.apache.jackrabbit.spi.common
import javax.jcr.RepositoryException;
/**
- * <code>TraversingQueryNodeVisitor</code> implements a base class for a
+ * {@code TraversingQueryNodeVisitor} implements a base class for a
* traversing query node visitor.
*/
public class TraversingQueryNodeVisitor extends DefaultQueryNodeVisitor {
+ @Override
public Object visit(OrQueryNode node, Object data) throws RepositoryException {
return node.acceptOperands(this, data);
}
+ @Override
public Object visit(AndQueryNode node, Object data) throws RepositoryException {
return node.acceptOperands(this, data);
}
+ @Override
public Object visit(QueryRootNode node, Object data) throws RepositoryException {
PathQueryNode pathNode = node.getLocationNode();
if (pathNode != null) {
@@ -44,18 +47,22 @@ public class TraversingQueryNodeVisitor
return data;
}
+ @Override
public Object visit(NotQueryNode node, Object data) throws RepositoryException {
return node.acceptOperands(this, data);
}
+ @Override
public Object visit(PathQueryNode node, Object data) throws RepositoryException {
return node.acceptOperands(this, data);
}
+ @Override
public Object visit(LocationStepQueryNode node, Object data) throws RepositoryException {
return node.acceptOperands(this, data);
}
+ @Override
public Object visit(DerefQueryNode node, Object data) throws RepositoryException {
return node.acceptOperands(this, data);
}
Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/AbstractQOMNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/AbstractQOMNode.java?rev=1166138&r1=1166137&r2=1166138&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/AbstractQOMNode.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/AbstractQOMNode.java Wed Sep 7 12:00:14 2011
@@ -23,7 +23,7 @@ import org.apache.jackrabbit.spi.Path;
import javax.jcr.NamespaceException;
/**
- * <code>AbstractQOMNode</code>...
+ * {@code AbstractQOMNode}...
*/
public abstract class AbstractQOMNode {
@@ -34,7 +34,7 @@ public abstract class AbstractQOMNode {
}
/**
- * Accepts a <code>visitor</code> and calls the appropriate visit method
+ * Accepts a {@code visitor} and calls the appropriate visit method
* depending on the type of this QOM node.
*
* @param visitor the visitor.
@@ -45,11 +45,11 @@ public abstract class AbstractQOMNode {
//---------------------------< internal >-----------------------------------
/**
- * Returns the JCR name string for the given <code>Name</code> or
- * <code>null</code> if <code>name</code> is <code>null</code>.
+ * Returns the JCR name string for the given {@code Name} or
+ * {@code null} if {@code name} is {@code null}.
*
- * @param name the <code>Name</code>.
- * @return the prefixed JCR name or <code>name.toString()</code> if an
+ * @param name the {@code Name}.
+ * @return the prefixed JCR name or {@code name.toString()} if an
* unknown namespace URI is encountered.
*/
protected String getJCRName(Name name) {
@@ -64,11 +64,11 @@ public abstract class AbstractQOMNode {
}
/**
- * Returns the JCR path String for the given <code>Path</code> object or
- * <code>null</code> if <code>path</code> is <code>null</code>.
+ * Returns the JCR path String for the given {@code Path} object or
+ * {@code null} if {@code path} is {@code null}.
*
- * @param path A <code>Path</code> object.
- * @return JCR path in the standard form or <code>path.toString()</code>
+ * @param path A {@code Path} object.
+ * @return JCR path in the standard form or {@code path.toString()}
* if an unknown namespace URI is encountered.
*/
protected String getJCRPath(Path path) {
@@ -84,17 +84,17 @@ public abstract class AbstractQOMNode {
protected String quote(Name name) {
String str = getJCRName(name);
- if (str.indexOf(':') != -1) {
- return "[" + str + "]";
- } else {
+ if (str.indexOf(':') == -1) {
return str;
+ } else {
+ return '[' + str + ']';
}
}
protected String quote(Path path) {
String str = getJCRPath(path);
if (str.indexOf(':') != -1 || str.indexOf('/') != -1) {
- return "[" + str + "]";
+ return '[' + str + ']';
} else {
return str;
}
@@ -102,8 +102,8 @@ public abstract class AbstractQOMNode {
protected String protect(Object expression) {
String str = expression.toString();
- if (str.indexOf(" ") != -1) {
- return "(" + str + ")";
+ if (str.contains(" ")) {
+ return '(' + str + ')';
} else {
return str;
}
Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/AndImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/AndImpl.java?rev=1166138&r1=1166137&r2=1166138&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/AndImpl.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/AndImpl.java Wed Sep 7 12:00:14 2011
@@ -16,13 +16,13 @@
*/
package org.apache.jackrabbit.spi.commons.query.qom;
+import org.apache.jackrabbit.spi.commons.conversion.NamePathResolver;
+
import javax.jcr.query.qom.And;
import javax.jcr.query.qom.Constraint;
-import org.apache.jackrabbit.spi.commons.conversion.NamePathResolver;
-
/**
- * <code>AndImpl</code>...
+ * {@code AndImpl}...
*/
public class AndImpl extends ConstraintImpl implements And {
@@ -38,8 +38,8 @@ public class AndImpl extends ConstraintI
AndImpl(NamePathResolver resolver, ConstraintImpl c1, ConstraintImpl c2) {
super(resolver);
- this.constraint1 = c1;
- this.constraint2 = c2;
+ constraint1 = c1;
+ constraint2 = c2;
}
/**
@@ -47,6 +47,7 @@ public class AndImpl extends ConstraintI
*
* @return the constraint; non-null
*/
+ @Override
public Constraint getConstraint1() {
return constraint1;
}
@@ -56,6 +57,7 @@ public class AndImpl extends ConstraintI
*
* @return the constraint; non-null
*/
+ @Override
public Constraint getConstraint2() {
return constraint2;
}
@@ -63,11 +65,12 @@ public class AndImpl extends ConstraintI
//------------------------< AbstractQOMNode >-------------------------------
/**
- * Accepts a <code>visitor</code> and calls the appropriate visit method
+ * Accepts a {@code visitor} and calls the appropriate visit method
* depending on the type of this QOM node.
*
* @param visitor the visitor.
*/
+ @Override
public Object accept(QOMTreeVisitor visitor, Object data) throws Exception {
return visitor.visit(this, data);
}
Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/BindVariableValueImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/BindVariableValueImpl.java?rev=1166138&r1=1166137&r2=1166138&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/BindVariableValueImpl.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/BindVariableValueImpl.java Wed Sep 7 12:00:14 2011
@@ -16,17 +16,15 @@
*/
package org.apache.jackrabbit.spi.commons.query.qom;
-import javax.jcr.query.qom.BindVariableValue;
-
-import org.apache.jackrabbit.spi.commons.conversion.NamePathResolver;
import org.apache.jackrabbit.spi.Name;
+import org.apache.jackrabbit.spi.commons.conversion.NamePathResolver;
+
+import javax.jcr.query.qom.BindVariableValue;
/**
- * <code>BindVariableValueImpl</code>...
+ * {@code BindVariableValueImpl}...
*/
-public class BindVariableValueImpl
- extends StaticOperandImpl
- implements BindVariableValue {
+public class BindVariableValueImpl extends StaticOperandImpl implements BindVariableValue {
/**
* The name of the bind variable.
@@ -54,6 +52,7 @@ public class BindVariableValueImpl
*
* @return the bind variable name; non-null
*/
+ @Override
public String getBindVariableName() {
return getJCRName(variableName);
}
@@ -61,11 +60,12 @@ public class BindVariableValueImpl
//------------------------< AbstractQOMNode >-------------------------------
/**
- * Accepts a <code>visitor</code> and calls the appropriate visit method
+ * Accepts a {@code visitor} and calls the appropriate visit method
* depending on the type of this QOM node.
*
* @param visitor the visitor.
*/
+ @Override
public Object accept(QOMTreeVisitor visitor, Object data) throws Exception {
return visitor.visit(this, data);
}
@@ -73,7 +73,7 @@ public class BindVariableValueImpl
//------------------------< Object >----------------------------------------
public String toString() {
- return "$" + getBindVariableName();
+ return '$' + getBindVariableName();
}
}
Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/ChildNodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/ChildNodeImpl.java?rev=1166138&r1=1166137&r2=1166138&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/ChildNodeImpl.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/ChildNodeImpl.java Wed Sep 7 12:00:14 2011
@@ -25,7 +25,7 @@ import javax.jcr.query.qom.ChildNode;
import javax.jcr.RepositoryException;
/**
- * <code>ChildNodeImpl</code>...
+ * {@code ChildNodeImpl}...
*/
public class ChildNodeImpl extends ConstraintImpl implements ChildNode {
@@ -39,14 +39,12 @@ public class ChildNodeImpl extends Const
*/
private final Path path;
- ChildNodeImpl(NamePathResolver resolver, Name selectorName, Path path)
- throws InvalidQueryException, RepositoryException {
+ ChildNodeImpl(NamePathResolver resolver, Name selectorName, Path path) throws RepositoryException {
super(resolver);
this.selectorName = selectorName;
this.path = path;
if (!path.isAbsolute()) {
- throw new InvalidQueryException(resolver.getJCRPath(path) +
- " is not an absolute path");
+ throw new InvalidQueryException(resolver.getJCRPath(path) + " is not an absolute path");
}
}
@@ -55,6 +53,7 @@ public class ChildNodeImpl extends Const
*
* @return the selector name; non-null
*/
+ @Override
public String getSelectorName() {
return getJCRName(selectorName);
}
@@ -64,6 +63,7 @@ public class ChildNodeImpl extends Const
*
* @return the path; non-null
*/
+ @Override
public String getParentPath() {
return getJCRPath(path);
}
@@ -89,11 +89,12 @@ public class ChildNodeImpl extends Const
//------------------------< AbstractQOMNode >-------------------------------
/**
- * Accepts a <code>visitor</code> and calls the appropriate visit method
+ * Accepts a {@code visitor} and calls the appropriate visit method
* depending on the type of this QOM node.
*
* @param visitor the visitor.
*/
+ @Override
public Object accept(QOMTreeVisitor visitor, Object data) throws Exception {
return visitor.visit(this, data);
}
@@ -101,7 +102,7 @@ public class ChildNodeImpl extends Const
//------------------------< Object >----------------------------------------
public String toString() {
- return "ISCHILDNODE(" + getSelectorName() + ", " + quote(path) + ")";
+ return "ISCHILDNODE(" + getSelectorName() + ", " + quote(path) + ')';
}
}
Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/ChildNodeJoinConditionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/ChildNodeJoinConditionImpl.java?rev=1166138&r1=1166137&r2=1166138&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/ChildNodeJoinConditionImpl.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/ChildNodeJoinConditionImpl.java Wed Sep 7 12:00:14 2011
@@ -16,17 +16,15 @@
*/
package org.apache.jackrabbit.spi.commons.query.qom;
-import javax.jcr.query.qom.ChildNodeJoinCondition;
-
-import org.apache.jackrabbit.spi.commons.conversion.NamePathResolver;
import org.apache.jackrabbit.spi.Name;
+import org.apache.jackrabbit.spi.commons.conversion.NamePathResolver;
+
+import javax.jcr.query.qom.ChildNodeJoinCondition;
/**
- * <code>ChildNodeJoinConditionImpl</code>...
+ * {@code ChildNodeJoinConditionImpl}...
*/
-public class ChildNodeJoinConditionImpl
- extends JoinConditionImpl
- implements ChildNodeJoinCondition {
+public class ChildNodeJoinConditionImpl extends JoinConditionImpl implements ChildNodeJoinCondition {
/**
* The name of the child selector.
@@ -51,6 +49,7 @@ public class ChildNodeJoinConditionImpl
*
* @return the selector name; non-null
*/
+ @Override
public String getChildSelectorName() {
return getJCRName(childSelectorName);
}
@@ -60,6 +59,7 @@ public class ChildNodeJoinConditionImpl
*
* @return the selector name; non-null
*/
+ @Override
public String getParentSelectorName() {
return getJCRName(parentSelectorName);
}
@@ -85,11 +85,12 @@ public class ChildNodeJoinConditionImpl
//------------------------< AbstractQOMNode >-------------------------------
/**
- * Accepts a <code>visitor</code> and calls the appropriate visit method
+ * Accepts a {@code visitor} and calls the appropriate visit method
* depending on the type of this QOM node.
*
* @param visitor the visitor.
*/
+ @Override
public Object accept(QOMTreeVisitor visitor, Object data) throws Exception {
return visitor.visit(this, data);
}
@@ -99,7 +100,7 @@ public class ChildNodeJoinConditionImpl
public String toString() {
String child = getChildSelectorName();
String parent = getParentSelectorName();
- return "ISCHILDNODE(" + child + ", " + parent + ")";
+ return "ISCHILDNODE(" + child + ", " + parent + ')';
}
}
Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/ColumnImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/ColumnImpl.java?rev=1166138&r1=1166137&r2=1166138&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/ColumnImpl.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/ColumnImpl.java Wed Sep 7 12:00:14 2011
@@ -16,18 +16,18 @@
*/
package org.apache.jackrabbit.spi.commons.query.qom;
-import javax.jcr.query.qom.Column;
-
import org.apache.jackrabbit.spi.Name;
import org.apache.jackrabbit.spi.commons.conversion.NamePathResolver;
+import javax.jcr.query.qom.Column;
+
/**
- * <code>ColumnImpl</code>...
+ * {@code ColumnImpl}...
*/
public class ColumnImpl extends AbstractQOMNode implements Column {
/**
- * Empty <code>ColumnImpl</code> array.
+ * Empty {@code ColumnImpl} array.
*/
public static final ColumnImpl[] EMPTY_ARRAY = new ColumnImpl[0];
@@ -82,6 +82,7 @@ public class ColumnImpl extends Abstract
*
* @return the selector name; non-null
*/
+ @Override
public String getSelectorName() {
return getJCRName(selectorName);
}
@@ -92,6 +93,7 @@ public class ColumnImpl extends Abstract
* @return the property name, or null to include a column for each
* single-value non-residual property of the selector's node type
*/
+ @Override
public String getPropertyName() {
return getJCRName(propertyName);
}
@@ -100,9 +102,10 @@ public class ColumnImpl extends Abstract
* Gets the column name.
* <p/>
*
- * @return the column name; must be null if <code>getPropertyName</code> is
+ * @return the column name; must be null if {@code getPropertyName} is
* null and non-null otherwise
*/
+ @Override
public String getColumnName() {
return columnName;
}
@@ -110,11 +113,12 @@ public class ColumnImpl extends Abstract
//------------------------< AbstractQOMNode >-------------------------------
/**
- * Accepts a <code>visitor</code> and calls the appropriate visit method
+ * Accepts a {@code visitor} and calls the appropriate visit method
* depending on the type of this QOM node.
*
* @param visitor the visitor.
*/
+ @Override
public Object accept(QOMTreeVisitor visitor, Object data) throws Exception {
return visitor.visit(this, data);
}
@@ -123,7 +127,7 @@ public class ColumnImpl extends Abstract
public String toString() {
if (propertyName != null) {
- return getSelectorName() + "." + getPropertyName()
+ return getSelectorName() + '.' + getPropertyName()
+ " AS " + getColumnName();
} else {
return getSelectorName() + ".*";
Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/ComparisonImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/ComparisonImpl.java?rev=1166138&r1=1166137&r2=1166138&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/ComparisonImpl.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/ComparisonImpl.java Wed Sep 7 12:00:14 2011
@@ -16,16 +16,16 @@
*/
package org.apache.jackrabbit.spi.commons.query.qom;
+import org.apache.jackrabbit.commons.query.qom.Operator;
+import org.apache.jackrabbit.spi.commons.conversion.NamePathResolver;
+
import javax.jcr.query.qom.Comparison;
import javax.jcr.query.qom.DynamicOperand;
import javax.jcr.query.qom.QueryObjectModelConstants;
import javax.jcr.query.qom.StaticOperand;
-import org.apache.jackrabbit.commons.query.qom.Operator;
-import org.apache.jackrabbit.spi.commons.conversion.NamePathResolver;
-
/**
- * <code>ComparisonImpl</code>...
+ * {@code ComparisonImpl}...
*/
public class ComparisonImpl extends ConstraintImpl implements Comparison {
@@ -65,6 +65,7 @@ public class ComparisonImpl extends Cons
*
* @return the operand; non-null
*/
+ @Override
public DynamicOperand getOperand1() {
return operand1;
}
@@ -81,6 +82,7 @@ public class ComparisonImpl extends Cons
* or</li> <li>{@link QueryObjectModelConstants#JCR_OPERATOR_LIKE}</li>
* </ul>
*/
+ @Override
public String getOperator() {
return operator.toString();
}
@@ -90,6 +92,7 @@ public class ComparisonImpl extends Cons
*
* @return the operand; non-null
*/
+ @Override
public StaticOperand getOperand2() {
return operand2;
}
@@ -97,11 +100,12 @@ public class ComparisonImpl extends Cons
//------------------------< AbstractQOMNode >-------------------------------
/**
- * Accepts a <code>visitor</code> and calls the appropriate visit method
+ * Accepts a {@code visitor} and calls the appropriate visit method
* depending on the type of this QOM node.
*
* @param visitor the visitor.
*/
+ @Override
public Object accept(QOMTreeVisitor visitor, Object data) throws Exception {
return visitor.visit(this, data);
}
Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/ConstraintImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/ConstraintImpl.java?rev=1166138&r1=1166137&r2=1166138&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/ConstraintImpl.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/ConstraintImpl.java Wed Sep 7 12:00:14 2011
@@ -16,17 +16,15 @@
*/
package org.apache.jackrabbit.spi.commons.query.qom;
-import javax.jcr.query.qom.Constraint;
-
import org.apache.jackrabbit.spi.commons.conversion.NamePathResolver;
+import javax.jcr.query.qom.Constraint;
+
/**
* <code>ConstraintImpl</code> is the common basis for classes that implement
* the {@link Constraint} interface.
*/
-public abstract class ConstraintImpl
- extends AbstractQOMNode
- implements Constraint {
+public abstract class ConstraintImpl extends AbstractQOMNode implements Constraint {
public ConstraintImpl(NamePathResolver resolver) {
super(resolver);
Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/DefaultQOMTreeVisitor.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/DefaultQOMTreeVisitor.java?rev=1166138&r1=1166137&r2=1166138&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/DefaultQOMTreeVisitor.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/DefaultQOMTreeVisitor.java Wed Sep 7 12:00:14 2011
@@ -17,196 +17,223 @@
package org.apache.jackrabbit.spi.commons.query.qom;
/**
- * <code>DefaultQOMTreeVisitor</code> default implementation of a {@link
+ * {@code DefaultQOMTreeVisitor} default implementation of a {@link
* QOMTreeVisitor}.
*/
public class DefaultQOMTreeVisitor implements QOMTreeVisitor {
/**
- * Does nothing and returns <code>data</code>.
+ * Does nothing and returns {@code data}.
*/
+ @Override
public Object visit(AndImpl node, Object data) throws Exception {
return data;
}
/**
- * Does nothing and returns <code>data</code>.
+ * Does nothing and returns {@code data}.
*/
+ @Override
public Object visit(BindVariableValueImpl node, Object data) throws Exception {
return data;
}
/**
- * Does nothing and returns <code>data</code>.
+ * Does nothing and returns {@code data}.
*/
+ @Override
public Object visit(ChildNodeImpl node, Object data) throws Exception {
return data;
}
/**
- * Does nothing and returns <code>data</code>.
+ * Does nothing and returns {@code data}.
*/
+ @Override
public Object visit(ChildNodeJoinConditionImpl node, Object data) throws Exception {
return data;
}
/**
- * Does nothing and returns <code>data</code>.
+ * Does nothing and returns {@code data}.
*/
+ @Override
public Object visit(ColumnImpl node, Object data) throws Exception {
return data;
}
/**
- * Does nothing and returns <code>data</code>.
+ * Does nothing and returns {@code data}.
*/
+ @Override
public Object visit(ComparisonImpl node, Object data) throws Exception {
return data;
}
/**
- * Does nothing and returns <code>data</code>.
+ * Does nothing and returns {@code data}.
*/
+ @Override
public Object visit(DescendantNodeImpl node, Object data) throws Exception {
return data;
}
/**
- * Does nothing and returns <code>data</code>.
+ * Does nothing and returns {@code data}.
*/
+ @Override
public Object visit(DescendantNodeJoinConditionImpl node, Object data) throws Exception {
return data;
}
/**
- * Does nothing and returns <code>data</code>.
+ * Does nothing and returns {@code data}.
*/
+ @Override
public Object visit(EquiJoinConditionImpl node, Object data) throws Exception {
return data;
}
/**
- * Does nothing and returns <code>data</code>.
+ * Does nothing and returns {@code data}.
*/
+ @Override
public Object visit(FullTextSearchImpl node, Object data) throws Exception {
return data;
}
/**
- * Does nothing and returns <code>data</code>.
+ * Does nothing and returns {@code data}.
*/
+ @Override
public Object visit(FullTextSearchScoreImpl node, Object data) throws Exception {
return data;
}
/**
- * Does nothing and returns <code>data</code>.
+ * Does nothing and returns {@code data}.
*/
+ @Override
public Object visit(JoinImpl node, Object data) throws Exception {
return data;
}
/**
- * Does nothing and returns <code>data</code>.
+ * Does nothing and returns {@code data}.
*/
+ @Override
public Object visit(LengthImpl node, Object data) throws Exception {
return data;
}
/**
- * Does nothing and returns <code>data</code>.
+ * Does nothing and returns {@code data}.
*/
+ @Override
public Object visit(LiteralImpl node, Object data) throws Exception {
return data;
}
/**
- * Does nothing and returns <code>data</code>.
+ * Does nothing and returns {@code data}.
*/
+ @Override
public Object visit(LowerCaseImpl node, Object data) throws Exception {
return data;
}
/**
- * Does nothing and returns <code>data</code>.
+ * Does nothing and returns {@code data}.
*/
+ @Override
public Object visit(NodeLocalNameImpl node, Object data) throws Exception {
return data;
}
/**
- * Does nothing and returns <code>data</code>.
+ * Does nothing and returns {@code data}.
*/
+ @Override
public Object visit(NodeNameImpl node, Object data) throws Exception {
return data;
}
/**
- * Does nothing and returns <code>data</code>.
+ * Does nothing and returns {@code data}.
*/
+ @Override
public Object visit(NotImpl node, Object data) throws Exception {
return data;
}
/**
- * Does nothing and returns <code>data</code>.
+ * Does nothing and returns {@code data}.
*/
+ @Override
public Object visit(OrderingImpl node, Object data) throws Exception {
return data;
}
/**
- * Does nothing and returns <code>data</code>.
+ * Does nothing and returns {@code data}.
*/
+ @Override
public Object visit(OrImpl node, Object data) throws Exception {
return data;
}
/**
- * Does nothing and returns <code>data</code>.
+ * Does nothing and returns {@code data}.
*/
+ @Override
public Object visit(PropertyExistenceImpl node, Object data) throws Exception {
return data;
}
/**
- * Does nothing and returns <code>data</code>.
+ * Does nothing and returns {@code data}.
*/
+ @Override
public Object visit(PropertyValueImpl node, Object data) throws Exception {
return data;
}
/**
- * Does nothing and returns <code>data</code>.
+ * Does nothing and returns {@code data}.
*/
+ @Override
public Object visit(QueryObjectModelTree node, Object data) throws Exception {
return data;
}
/**
- * Does nothing and returns <code>data</code>.
+ * Does nothing and returns {@code data}.
*/
+ @Override
public Object visit(SameNodeImpl node, Object data) throws Exception {
return data;
}
/**
- * Does nothing and returns <code>data</code>.
+ * Does nothing and returns {@code data}.
*/
+ @Override
public Object visit(SameNodeJoinConditionImpl node, Object data) throws Exception {
return data;
}
/**
- * Does nothing and returns <code>data</code>.
+ * Does nothing and returns {@code data}.
*/
+ @Override
public Object visit(SelectorImpl node, Object data) throws Exception {
return data;
}
/**
- * Does nothing and returns <code>data</code>.
+ * Does nothing and returns {@code data}.
*/
+ @Override
public Object visit(UpperCaseImpl node, Object data) throws Exception {
return data;
}
Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/DefaultTraversingQOMTreeVisitor.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/DefaultTraversingQOMTreeVisitor.java?rev=1166138&r1=1166137&r2=1166138&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/DefaultTraversingQOMTreeVisitor.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/DefaultTraversingQOMTreeVisitor.java Wed Sep 7 12:00:14 2011
@@ -17,7 +17,7 @@
package org.apache.jackrabbit.spi.commons.query.qom;
/**
- * <code>DefaultTraversingQOMTreeVisitor</code> default implementation of a
+ * {@code DefaultTraversingQOMTreeVisitor} default implementation of a
* traversing {@link QOMTreeVisitor}.
*/
public class DefaultTraversingQOMTreeVisitor extends DefaultQOMTreeVisitor {
@@ -25,6 +25,7 @@ public class DefaultTraversingQOMTreeVis
/**
* Calls accept on each of the attached constraints of the AND node.
*/
+ @Override
public final Object visit(AndImpl node, Object data) throws Exception {
((ConstraintImpl) node.getConstraint1()).accept(this, data);
((ConstraintImpl) node.getConstraint2()).accept(this, data);
@@ -34,6 +35,7 @@ public class DefaultTraversingQOMTreeVis
/**
* Calls accept on the two operands in the comparison node.
*/
+ @Override
public Object visit(ComparisonImpl node, Object data) throws Exception {
((DynamicOperandImpl) node.getOperand1()).accept(this, data);
((StaticOperandImpl) node.getOperand2()).accept(this, data);
@@ -43,6 +45,7 @@ public class DefaultTraversingQOMTreeVis
/**
* Calls accept on the static operand in the fulltext search constraint.
*/
+ @Override
public Object visit(FullTextSearchImpl node, Object data) throws Exception {
((StaticOperandImpl) node.getFullTextSearchExpression()).accept(this, data);
return data;
@@ -51,6 +54,7 @@ public class DefaultTraversingQOMTreeVis
/**
* Calls accept on the two sources and the join condition in the join node.
*/
+ @Override
public Object visit(JoinImpl node, Object data) throws Exception {
((SourceImpl) node.getRight()).accept(this, data);
((SourceImpl) node.getLeft()).accept(this, data);
@@ -61,6 +65,7 @@ public class DefaultTraversingQOMTreeVis
/**
* Calls accept on the property value in the length node.
*/
+ @Override
public Object visit(LengthImpl node, Object data) throws Exception {
((PropertyValueImpl) node.getPropertyValue()).accept(this, data);
return data;
@@ -69,6 +74,7 @@ public class DefaultTraversingQOMTreeVis
/**
* Calls accept on the dynamic operand in the lower-case node.
*/
+ @Override
public Object visit(LowerCaseImpl node, Object data) throws Exception {
((DynamicOperandImpl) node.getOperand()).accept(this, data);
return data;
@@ -77,6 +83,7 @@ public class DefaultTraversingQOMTreeVis
/**
* Calls accept on the constraint in the NOT node.
*/
+ @Override
public Object visit(NotImpl node, Object data) throws Exception {
((ConstraintImpl) node.getConstraint()).accept(this, data);
return data;
@@ -85,6 +92,7 @@ public class DefaultTraversingQOMTreeVis
/**
* Calls accept on the dynamic operand in the ordering node.
*/
+ @Override
public Object visit(OrderingImpl node, Object data) throws Exception {
((DynamicOperandImpl) node.getOperand()).accept(this, data);
return data;
@@ -93,6 +101,7 @@ public class DefaultTraversingQOMTreeVis
/**
* Calls accept on each of the attached constraints of the OR node.
*/
+ @Override
public Object visit(OrImpl node, Object data) throws Exception {
((ConstraintImpl) node.getConstraint1()).accept(this, data);
((ConstraintImpl) node.getConstraint2()).accept(this, data);
@@ -108,6 +117,7 @@ public class DefaultTraversingQOMTreeVis
* <li>Columns</li>
* </ul>
*/
+ @Override
public Object visit(QueryObjectModelTree node, Object data) throws Exception {
node.getSource().accept(this, data);
ConstraintImpl constraint = node.getConstraint();
@@ -115,12 +125,12 @@ public class DefaultTraversingQOMTreeVis
constraint.accept(this, data);
}
OrderingImpl[] orderings = node.getOrderings();
- for (int i = 0; i < orderings.length; i++) {
- orderings[i].accept(this, data);
+ for (OrderingImpl ordering : orderings) {
+ ordering.accept(this, data);
}
ColumnImpl[] columns = node.getColumns();
- for (int i = 0; i < columns.length; i++) {
- columns[i].accept(this, data);
+ for (ColumnImpl column : columns) {
+ column.accept(this, data);
}
return data;
}
@@ -128,6 +138,7 @@ public class DefaultTraversingQOMTreeVis
/**
* Calls accept on the dynamic operand in the lower-case node.
*/
+ @Override
public Object visit(UpperCaseImpl node, Object data) throws Exception {
((DynamicOperandImpl) node.getOperand()).accept(this, data);
return data;
Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/DescendantNodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/DescendantNodeImpl.java?rev=1166138&r1=1166137&r2=1166138&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/DescendantNodeImpl.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/DescendantNodeImpl.java Wed Sep 7 12:00:14 2011
@@ -25,11 +25,9 @@ import javax.jcr.query.qom.DescendantNod
import javax.jcr.NamespaceException;
/**
- * <code>DescendantNodeImpl</code>...
+ * {@code DescendantNodeImpl}...
*/
-public class DescendantNodeImpl
- extends ConstraintImpl
- implements DescendantNode {
+public class DescendantNodeImpl extends ConstraintImpl implements DescendantNode {
/**
* A selector name.
@@ -59,6 +57,7 @@ public class DescendantNodeImpl
*
* @return the selector name; non-null
*/
+ @Override
public String getSelectorName() {
return getJCRName(selectorName);
}
@@ -68,6 +67,7 @@ public class DescendantNodeImpl
*
* @return the path; non-null
*/
+ @Override
public String getAncestorPath() {
return getJCRPath(path);
}
@@ -93,11 +93,12 @@ public class DescendantNodeImpl
//------------------------< AbstractQOMNode >-------------------------------
/**
- * Accepts a <code>visitor</code> and calls the appropriate visit method
+ * Accepts a {@code visitor} and calls the appropriate visit method
* depending on the type of this QOM node.
*
* @param visitor the visitor.
*/
+ @Override
public Object accept(QOMTreeVisitor visitor, Object data) throws Exception {
return visitor.visit(this, data);
}
@@ -105,7 +106,7 @@ public class DescendantNodeImpl
//------------------------< Object >----------------------------------------
public String toString() {
- return "ISDESCENDANTNODE(" + getSelectorName() + ", " + quote(path) + ")";
+ return "ISDESCENDANTNODE(" + getSelectorName() + ", " + quote(path) + ')';
}
}