incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r881840 - in /sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper: ResourceProviderEntry2.java WrappedResourceProvider.java jcr/JcrResourceProviderEntry.java
Date Wed, 18 Nov 2009 17:27:15 GMT
Author: cziegeler
Date: Wed Nov 18 17:27:14 2009
New Revision: 881840

URL: http://svn.apache.org/viewvc?rev=881840&view=rev
Log:
Fix formatting and javadocs.

Modified:
    sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/ResourceProviderEntry2.java
    sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/WrappedResourceProvider.java
    sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProviderEntry.java

Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/ResourceProviderEntry2.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/ResourceProviderEntry2.java?rev=881840&r1=881839&r2=881840&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/ResourceProviderEntry2.java
(original)
+++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/ResourceProviderEntry2.java
Wed Nov 18 17:27:14 2009
@@ -18,14 +18,6 @@
  */
 package org.apache.sling.jcr.resource.internal.helper;
 
-import org.apache.commons.collections.FastTreeMap;
-import org.apache.sling.api.resource.Resource;
-import org.apache.sling.api.resource.ResourceProvider;
-import org.apache.sling.api.resource.ResourceResolver;
-import org.apache.sling.api.resource.SyntheticResource;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -40,6 +32,14 @@
 import java.util.NoSuchElementException;
 import java.util.Set;
 
+import org.apache.commons.collections.FastTreeMap;
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.api.resource.ResourceProvider;
+import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.sling.api.resource.SyntheticResource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 /**
  * The <code>ResourceProviderEntry</code> class represents a node in the tree
of
  * resource providers spanned by the root paths of the provider resources.
@@ -51,10 +51,10 @@
         Comparable<ResourceProviderEntry2> {
 
     /**
-     * 
+     *
      */
     private static final long serialVersionUID = 7420631325909144862L;
-    
+
     private static Logger LOGGER = LoggerFactory.getLogger(ResourceProviderEntry2.class);
 
     // the path to resources provided by the resource provider of this
@@ -85,10 +85,10 @@
      * Creates an instance of this class with the given path relative to the
      * parent resource provider entry, encapsulating the given ResourceProvider,
      * and a number of inital child entries.
-     * 
+     *
      * @param path
      *            The relative path supported by the provider
-     * @param provider
+     * @param providerList
      *            The resource provider to encapsulate by this entry.
      */
     public ResourceProviderEntry2(String path, ResourceProvider[] providerList) {
@@ -109,7 +109,7 @@
             }
           }
         }
-        
+
         // this will consume slightly more memory but ensures read is fast.
         storageMap.setFast(true);
     }
@@ -125,7 +125,7 @@
      * Returns the resource with the given path or <code>null</code> if neither
      * the resource provider of this entry nor the resource provider of any of
      * the child entries can provide the resource.
-     * 
+     *
      * @param path
      *            The path to the resource to return.
      * @return The resource for the path or <code>null</code> if no resource
can
@@ -149,7 +149,7 @@
             private Map<String, Resource> delayed;
 
             private Set<String> visited;
-            
+
             private String iteratorPath;
 
             private Iterator<Resource> delayedIter;
@@ -165,7 +165,7 @@
                 // for each resource provider
                 Set<ResourceProvider> providersSet = new LinkedHashSet<ResourceProvider>();
                 getResourceProviders(path, providersSet);
-                
+
                 if ( LOGGER.isDebugEnabled()) {
                     LOGGER.debug(" Provider Set for path {} {} ",path,Arrays.toString(providersSet.toArray(new
ResourceProvider[0])));
                 }
@@ -256,7 +256,7 @@
 
     /**
      * Adds the given resource provider into the tree for the given prefix.
-     * 
+     *
      * @return <code>true</code> if the provider could be entered into the
      *         subtree below this entry. Otherwise <code>false</code> is
      *         returned.
@@ -281,34 +281,18 @@
 
 
     //------------------ Map methods, here so that we can delegate 2 maps together
-    /**
-     * @param string
-     * @param rpe2
-     */
     public void put(String key, ResourceProviderEntry2 value) {
         storageMap.put(key,value);
     }
-    
-    /**
-     * @param element
-     * @return
-     */
+
     public boolean containsKey(String key) {
         return storageMap.containsKey(key);
     }
 
-
-    /**
-     * @param element
-     * @return
-     */
     public ResourceProviderEntry2 get(String key) {
         return (ResourceProviderEntry2) storageMap.get(key);
     }
 
-    /**
-     * @return
-     */
     @SuppressWarnings("unchecked")
     public Collection<ResourceProviderEntry2> values() {
         return storageMap.values();
@@ -338,7 +322,7 @@
 
     /**
      * Adds a list of providers to this entry.
-     * 
+     *
      * @param provider
      */
     private boolean addInternalProvider(WrappedResourceProvider provider) {
@@ -390,7 +374,7 @@
                 Comparable c2 = o2.getComparable();
                 if ( c1 == null && c2 == null ) {
                   return 0;
-                } 
+                }
                 if ( c1 == null ) {
                   return -1;
                 }
@@ -407,10 +391,9 @@
     /**
      * Get a of ResourceProvidersEntries leading to the fullPath in reverse
      * order.
-     * 
+     *
      * @param fullPath
      *            the full path
-     * @return a reverse order list of ProviderEntries to the path.
      */
     private void populateProviderPath(
         List<ResourceProviderEntry2> providerEntryPath, String[] elements) {
@@ -432,7 +415,7 @@
 
     /**
      * Resolve a resource from a path into a Resource
-     * 
+     *
      * @param resolver
      *            the ResourceResolver.
      * @param fullPath
@@ -450,8 +433,8 @@
                 LOGGER.debug("Not absolute {} :{}",fullPath,(System.currentTimeMillis() -
start));
                 return null; // fullpath must be absolute
             }
-            String[] elements = split(fullPath, '/'); 
-            
+            String[] elements = split(fullPath, '/');
+
             List<ResourceProviderEntry2> list = new ArrayList<ResourceProviderEntry2>();
             populateProviderPath(list, elements);
             // the path is in reverse order end first
@@ -470,7 +453,7 @@
                     }
                 }
             }
-            
+
             // resolve against this one
             ResourceProvider[] rps = getResourceProviders();
             for (ResourceProvider rp : rps) {
@@ -481,10 +464,10 @@
                     return resource;
                 }
             }
-            
+
             // query: /libs/sling/servlet/default
             // resource Provider: libs/sling/servlet/default/GET.servlet
-            // list will match libs, sling, servlet, default 
+            // list will match libs, sling, servlet, default
             // and there will be no resource provider at the end
             if (list.size() > 0 && list.size() == elements.length ) {
                 if ( list.get(list.size()-1).getResourceProviders().length == 0 ) {
@@ -513,7 +496,7 @@
     /**
      * Returns all resource providers which provider resources whose prefix is
      * the given path.
-     * 
+     *
      * @param path
      *            The prefix path to match the resource provider roots against
      * @param providers
@@ -614,9 +597,6 @@
         return e;
     }
 
-    /**
-     * @return
-     */
     public String getResolutionStats() {
         long tot = nreal + nsynthetic + nmiss;
         if (tot == 0) {
@@ -636,7 +616,7 @@
 
     /**
      * {@inheritDoc}
-     * 
+     *
      * @see java.util.AbstractMap#toString()
      */
     @Override

Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/WrappedResourceProvider.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/WrappedResourceProvider.java?rev=881840&r1=881839&r2=881840&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/WrappedResourceProvider.java
(original)
+++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/WrappedResourceProvider.java
Wed Nov 18 17:27:14 2009
@@ -17,90 +17,91 @@
  */
 package org.apache.sling.jcr.resource.internal.helper;
 
-import org.apache.sling.api.resource.Resource;
-import org.apache.sling.api.resource.ResourceProvider;
-import org.apache.sling.api.resource.ResourceResolver;
-
 import java.util.Iterator;
 
 import javax.servlet.http.HttpServletRequest;
 
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.api.resource.ResourceProvider;
+import org.apache.sling.api.resource.ResourceResolver;
+
 /**
  *
  */
 public class WrappedResourceProvider  implements ResourceProvider {
 
-  private ResourceProvider resourceProvider;
-  private Comparable<?> serviceReference;
+    private ResourceProvider resourceProvider;
+    private Comparable<?> serviceReference;
+
+    /**
+     *
+     */
+    public WrappedResourceProvider(ResourceProvider resourceProvider, Comparable<?>
serviceReference) {
+        this.resourceProvider = resourceProvider;
+        this.serviceReference = serviceReference;
+    }
+
+    /**
+     * {@inheritDoc}
+     * @see org.apache.sling.api.resource.ResourceProvider#getResource(org.apache.sling.api.resource.ResourceResolver,
java.lang.String)
+     */
+    public Resource getResource(ResourceResolver arg0, String arg1) {
+        return resourceProvider.getResource(arg0, arg1);
+    }
+
+    /**
+     * {@inheritDoc}
+     * @see org.apache.sling.api.resource.ResourceProvider#getResource(org.apache.sling.api.resource.ResourceResolver,
javax.servlet.http.HttpServletRequest, java.lang.String)
+     */
+    public Resource getResource(ResourceResolver arg0, HttpServletRequest arg1, String arg2)
{
+        return resourceProvider.getResource(arg0, arg1, arg2);
+    }
+
+    /**
+     * {@inheritDoc}
+     * @see org.apache.sling.api.resource.ResourceProvider#listChildren(org.apache.sling.api.resource.Resource)
+     */
+    public Iterator<Resource> listChildren(Resource arg0) {
+        return resourceProvider.listChildren(arg0);
+    }
+
+    /**
+     *
+     */
+    public Comparable<?> getComparable() {
+        return serviceReference;
+    }
+
+    /**
+     * {@inheritDoc}
+     * @see java.lang.Object#hashCode()
+     */
+    @Override
+    public int hashCode() {
+        return resourceProvider.hashCode();
+    }
+
+    /**
+     * {@inheritDoc}
+     * @see java.lang.Object#equals(java.lang.Object)
+     */
+    @Override
+    public boolean equals(Object obj) {
+        if ( obj instanceof WrappedResourceProvider ) {
+            return resourceProvider.equals(((WrappedResourceProvider) obj).resourceProvider);
+        } else if ( obj instanceof ResourceProvider) {
+            return resourceProvider.equals(obj);
+        }
+        return super.equals(obj);
+    }
 
-  /**
-   * 
-   */
-  public WrappedResourceProvider(ResourceProvider resourceProvider, Comparable<?> serviceReference)
{
-    this.resourceProvider = resourceProvider;
-    this.serviceReference = serviceReference;
-  }
-  /**
-   * {@inheritDoc}
-   * @see org.apache.sling.api.resource.ResourceProvider#getResource(org.apache.sling.api.resource.ResourceResolver,
java.lang.String)
-   */
-  public Resource getResource(ResourceResolver arg0, String arg1) {
-    return resourceProvider.getResource(arg0, arg1);
-  }
-
-  /**
-   * {@inheritDoc}
-   * @see org.apache.sling.api.resource.ResourceProvider#getResource(org.apache.sling.api.resource.ResourceResolver,
javax.servlet.http.HttpServletRequest, java.lang.String)
-   */
-  public Resource getResource(ResourceResolver arg0, HttpServletRequest arg1, String arg2)
{
-    return resourceProvider.getResource(arg0, arg1, arg2);
-  }
-
-  /**
-   * {@inheritDoc}
-   * @see org.apache.sling.api.resource.ResourceProvider#listChildren(org.apache.sling.api.resource.Resource)
-   */
-  public Iterator<Resource> listChildren(Resource arg0) {
-    return resourceProvider.listChildren(arg0);
-  }
-  /**
-   * @return
-   */
-  public Comparable<?> getComparable() {
-    return serviceReference;
-  }
-  
-  /**
-   * {@inheritDoc}
-   * @see java.lang.Object#hashCode()
-   */
-  @Override
-  public int hashCode() {
-    return resourceProvider.hashCode();
-  }
-  
-  /**
-   * {@inheritDoc}
-   * @see java.lang.Object#equals(java.lang.Object)
-   */
-  @Override
-  public boolean equals(Object obj) {
-    if ( obj instanceof WrappedResourceProvider ) {
-      return resourceProvider.equals(((WrappedResourceProvider) obj).resourceProvider);
-    } else if ( obj instanceof ResourceProvider) {
-      return resourceProvider.equals(obj);
-    }
-    return super.equals(obj);
-  }
-  
     /**
      * {@inheritDoc}
-     * 
+     *
      * @see java.lang.Object#toString()
      */
     @Override
     public String toString() {
         return resourceProvider.toString();
     }
-
 }

Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProviderEntry.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProviderEntry.java?rev=881840&r1=881839&r2=881840&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProviderEntry.java
(original)
+++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProviderEntry.java
Wed Nov 18 17:27:14 2009
@@ -18,20 +18,20 @@
  */
 package org.apache.sling.jcr.resource.internal.helper.jcr;
 
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
 import javax.jcr.Session;
 
 import org.apache.sling.api.resource.ResourceProvider;
 import org.apache.sling.jcr.resource.JcrResourceTypeProvider;
 import org.apache.sling.jcr.resource.internal.helper.ResourceProviderEntry2;
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
 public class JcrResourceProviderEntry extends ResourceProviderEntry2 {
 
     /**
-     * 
+     *
      */
     private static final long serialVersionUID = 5672648586247261128L;
 
@@ -74,14 +74,14 @@
 
     /**
      * {@inheritDoc}
-     * 
+     *
      * @see org.apache.sling.jcr.resource.internal.helper.ResourceProviderEntry2#put(java.lang.String,
      *      org.apache.sling.jcr.resource.internal.helper.ResourceProviderEntry2)
      */
 
     /**
      * {@inheritDoc}
-     * 
+     *
      * @see org.apache.sling.jcr.resource.internal.helper.ResourceProviderEntry2#get(java.lang.String)
      */
     @Override
@@ -95,7 +95,7 @@
 
     /**
      * {@inheritDoc}
-     * 
+     *
      * @see org.apache.sling.jcr.resource.internal.helper.ResourceProviderEntry2#values()
      */
     @Override
@@ -108,7 +108,7 @@
 
     /**
      * {@inheritDoc}
-     * 
+     *
      * @see org.apache.sling.jcr.resource.internal.helper.ResourceProviderEntry2#containsKey(java.lang.String)
      */
     @Override
@@ -118,8 +118,8 @@
 
     /**
      * {@inheritDoc}
-     * 
-     * @see org.apache.sling.jcr.resource.internal.helper.ResourceProviderEntry#getResourceProviders()
+     *
+     * @see org.apache.sling.jcr.resource.internal.helper.ResourceProviderEntry2#getResourceProviders()
      */
     @Override
     public ResourceProvider[] getResourceProviders() {
@@ -149,7 +149,7 @@
 
     /**
      * {@inheritDoc}
-     * 
+     *
      * @see org.apache.sling.jcr.resource.internal.helper.ResourceProviderEntry2#toString()
      */
     @Override



Mime
View raw message