javadoc update
diff --git a/src/main/java/org/apache/sling/resource/filter/ResourceFilter.java b/src/main/java/org/apache/sling/resource/filter/ResourceFilter.java
index 795f94f..f3f2802 100644
--- a/src/main/java/org/apache/sling/resource/filter/ResourceFilter.java
+++ b/src/main/java/org/apache/sling/resource/filter/ResourceFilter.java
@@ -26,7 +26,7 @@
public interface ResourceFilter {
/**
- * Creates a Predicate<Resource> based on the scripted matching
+ * Creates a Predicate<Resource> based on the script
*
* @param filter
* @return
@@ -35,7 +35,7 @@
public Predicate<Resource> parse(String filter) throws ResourceFilterException;
/**
- * Creates a Predicate<Resource> based on the scripted matching
+ * Creates a Predicate<Resource> based on the script
*
* @param filter
* @param charEncoding
@@ -48,16 +48,17 @@
* Add a series of key - value pairs that can then be evaluated as part of the
* filter creation
*
- * @param params
+ * @param params Map of Key - Value pairs
* @return this
*/
public abstract ResourceFilter addParams(Map<String, Object> params);
/**
- * Add a key - value pair that can then be evaluated as part of the filter
+ * Adds a key - value pair that can then be evaluated as part of the filter
* creation
*
- * @param params
+ * @param key
+ * @param value
* @return this
*/
public abstract ResourceFilter addParam(String key, Object value);
diff --git a/src/main/java/org/apache/sling/resource/filter/ResourceFilterException.java b/src/main/java/org/apache/sling/resource/filter/ResourceFilterException.java
index e06e2cd..5829f29 100644
--- a/src/main/java/org/apache/sling/resource/filter/ResourceFilterException.java
+++ b/src/main/java/org/apache/sling/resource/filter/ResourceFilterException.java
@@ -18,6 +18,12 @@
*/
package org.apache.sling.resource.filter;
+/**
+ * Used to wrap internally generated Parser exceptions when a malformed scipt is
+ * provided
+ *
+ *
+ */
public class ResourceFilterException extends Exception {
public ResourceFilterException(Throwable cause) {
@@ -26,5 +32,4 @@
private static final long serialVersionUID = 5893818236312416308L;
-
}
diff --git a/src/main/java/org/apache/sling/resource/filter/ResourceFilterProvider.java b/src/main/java/org/apache/sling/resource/filter/ResourceFilterProvider.java
index bc80b3e..a8ae061 100644
--- a/src/main/java/org/apache/sling/resource/filter/ResourceFilterProvider.java
+++ b/src/main/java/org/apache/sling/resource/filter/ResourceFilterProvider.java
@@ -20,6 +20,11 @@
public interface ResourceFilterProvider {
+ /**
+ * Generates a unique ResourceFilter per request
+ *
+ * @return
+ */
public ResourceFilter getResourceFilter();
}
diff --git a/src/main/java/org/apache/sling/resource/filter/ResourceFilterStream.java b/src/main/java/org/apache/sling/resource/filter/ResourceFilterStream.java
index 6bf389b..e2dd9d8 100644
--- a/src/main/java/org/apache/sling/resource/filter/ResourceFilterStream.java
+++ b/src/main/java/org/apache/sling/resource/filter/ResourceFilterStream.java
@@ -20,7 +20,6 @@
import org.apache.sling.api.resource.Resource;
import org.apache.sling.resource.filter.ResourceFilterStream;
-
/**
* Creates a {@link Predicate} of type {@link Resource} to identify matching
* Resource objects
@@ -42,13 +41,13 @@
}
/**
- * Creates a Stream<Resource> using the branchSelector to create the traversal
- * predicate to select the appropriate child resources
+ * Adds a branchSelector to define which child resource are acceptable to travel
+ * down as part of the Resource traversal
*
* @param branchSelector
* resourceFilter script for traversal control
- * @return ResourceStream
- * @throws ParseException
+ * @return ResourceStreamFilter
+ * @throws ResourceFilterException
*/
public ResourceFilterStream setBranchSelector(String branchSelector) throws ResourceFilterException {
this.branchSelector = resourceFilter.parse(branchSelector);
@@ -56,15 +55,13 @@
}
/**
- * Creates a Stream<Resource> using the branchSelector to create the traversal
- * predicate to select the appropriate child resources
+ * Adds a childSelector to define which child resources should be part of the
+ * stream
*
- * @param branchSelector
- * resourceFilter script for traversal control
- * @param charEncoding
- * char encoding of the branch selector String
- * @return ResourceStream
- * @throws ParseException
+ * @param childSelector
+ * resourceFilter script to identify child resources to return
+ * @return ResourceStreamFilter
+ * @throws ResourceFilterException
*/
public ResourceFilterStream setChildSelector(String childSelector) throws ResourceFilterException {
this.childSelector = resourceFilter.parse(childSelector);
@@ -94,6 +91,12 @@
return this;
}
+ /**
+ * Stream<Resource> which uses the branchSelector as the basis of the traversal
+ * and then filters the resources based on the childSelector that was provided
+ *
+ * @return pre filterd Stream<Resource>
+ */
public Stream<Resource> stream() {
return resources.stream(branchSelector).filter(childSelector);
}