You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ra...@apache.org on 2015/07/13 19:08:18 UTC

svn commit: r1690757 - in /sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource: ./ internal/ internal/helper/ internal/helper/jcr/

Author: radu
Date: Mon Jul 13 17:08:18 2015
New Revision: 1690757

URL: http://svn.apache.org/r1690757
Log:
trivial: updated JavaDoc to allow releases with JRE >= 1.8

Modified:
    sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrPropertyMap.java
    sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrResourceResolverFactory.java
    sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrResourceUtil.java
    sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrModifiableValueMap.java
    sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverFactoryImpl.java
    sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/NodeUtil.java
    sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/ObservationListenerSupport.java
    sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/Converter.java
    sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/JcrPropertyMapCacheEntry.java
    sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResourceIterator.java

Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrPropertyMap.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrPropertyMap.java?rev=1690757&r1=1690756&r2=1690757&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrPropertyMap.java (original)
+++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrPropertyMap.java Mon Jul 13 17:08:18 2015
@@ -89,6 +89,8 @@ public class JcrPropertyMap
 
     /**
      * Get the node.
+     *
+     * @return the node
      */
     protected Node getNode() {
         return node;
@@ -226,6 +228,7 @@ public class JcrPropertyMap
     /**
      * Return the path of the current node.
      *
+     * @return the path
      * @throws IllegalStateException If a repository exception occurs
      * @deprecated
      */
@@ -243,7 +246,7 @@ public class JcrPropertyMap
     /**
      * Put a single property into the cache
      * @param prop
-     * @return
+     * @return the cached property
      * @throws IllegalArgumentException if a repository exception occurs
      */
     private JcrPropertyMapCacheEntry cacheProperty(final Property prop) {
@@ -364,8 +367,9 @@ public class JcrPropertyMap
      * Handles key name escaping by taking into consideration if it contains a
      * registered prefix
      *
-     * @param key
+     * @param key the key to escape
      * @return escaped key name
+     * @throws RepositoryException if the repository's namespaced prefixes cannot be retrieved
      */
     protected String escapeKeyName(final String key) throws RepositoryException {
         final int indexOfPrefix = key.indexOf(':');
@@ -385,8 +389,11 @@ public class JcrPropertyMap
     }
 
     /**
-    * Read namespace prefixes and store as member variable to minimize number of JCR API calls
-    */
+     * Read namespace prefixes and store as member variable to minimize number of JCR API calls
+     *
+     * @return the namespace prefixes
+     * @throws RepositoryException  if the namespace prefixes cannot be retrieved
+     */
     protected String[] getNamespacePrefixes() throws RepositoryException {
         if (this.namespacePrefixes == null) {
             this.namespacePrefixes = getNode().getSession().getNamespacePrefixes();

Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrResourceResolverFactory.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrResourceResolverFactory.java?rev=1690757&r1=1690756&r2=1690757&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrResourceResolverFactory.java (original)
+++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrResourceResolverFactory.java Mon Jul 13 17:08:18 2015
@@ -65,6 +65,7 @@ public interface JcrResourceResolverFact
      *
      * @param session The JCR <code>Session</code> used by the created resource
      *            manager to access the repository.
+     * @return the resource resolver
      */
     ResourceResolver getResourceResolver(Session session);
 

Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrResourceUtil.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrResourceUtil.java?rev=1690757&r1=1690756&r2=1690757&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrResourceUtil.java (original)
+++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrResourceUtil.java Mon Jul 13 17:08:18 2015
@@ -46,7 +46,15 @@ import org.apache.sling.jcr.resource.int
  */
 public class JcrResourceUtil {
 
-    /** Helper method to execute a JCR query */
+    /**
+     * Helper method to execute a JCR query.
+     *
+     * @param session the session
+     * @param query the query
+     * @param language the language
+     * @return the query's result
+     * @throws RepositoryException if the {@link QueryManager} cannot be retrieved
+     */
     public static QueryResult query(Session session, String query,
             String language) throws RepositoryException {
         QueryManager qManager = session.getWorkspace().getQueryManager();
@@ -54,7 +62,13 @@ public class JcrResourceUtil {
         return q.execute();
     }
 
-    /** Converts a JCR Value to a corresponding Java Object */
+    /**
+     * Converts a JCR Value to a corresponding Java Object
+     *
+     * @param value the JCR Value to convert
+     * @return the Java Object
+     * @throws RepositoryException if the value cannot be converted
+     */
     public static Object toJavaObject(Value value) throws RepositoryException {
         switch (value.getType()) {
             case PropertyType.DECIMAL:
@@ -83,6 +97,10 @@ public class JcrResourceUtil {
      * Converts the value(s) of a JCR Property to a corresponding Java Object.
      * If the property has multiple values the result is an array of Java
      * Objects representing the converted values of the property.
+     *
+     * @param property the property to be converted to the corresponding Java Object
+     * @throws RepositoryException if the conversion cannot take place
+     * @return the Object resulting from the conversion
      */
     public static Object toJavaObject(Property property)
             throws RepositoryException {
@@ -167,6 +185,7 @@ public class JcrResourceUtil {
      * @param node         The node where the property will be set on.
      * @param propertyName The name of the property.
      * @param propertyValue The value for the property.
+     * @throws RepositoryException if the property cannot be set
      */
     public static void setProperty(final Node node,
                                    final String propertyName,

Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrModifiableValueMap.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrModifiableValueMap.java?rev=1690757&r1=1690756&r2=1690757&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrModifiableValueMap.java (original)
+++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrModifiableValueMap.java Mon Jul 13 17:08:18 2015
@@ -213,6 +213,7 @@ public final class JcrModifiableValueMap
     /**
      * Return the path of the current node.
      *
+     * @return the path
      * @throws IllegalStateException If a repository exception occurs
      */
     public String getPath() {
@@ -349,8 +350,9 @@ public final class JcrModifiableValueMap
      * Handles key name escaping by taking into consideration if it contains a
      * registered prefix
      *
-     * @param key
+     * @param key the key to escape
      * @return escaped key name
+     * @throws RepositoryException if the repository's namespace prefixes cannot be retrieved
      */
     protected String escapeKeyName(final String key) throws RepositoryException {
         final int indexOfPrefix = key.indexOf(':');

Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverFactoryImpl.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverFactoryImpl.java?rev=1690757&r1=1690756&r2=1690757&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverFactoryImpl.java (original)
+++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverFactoryImpl.java Mon Jul 13 17:08:18 2015
@@ -63,7 +63,11 @@ public class JcrResourceResolverFactoryI
     @Reference(cardinality = ReferenceCardinality.OPTIONAL_UNARY, policy = ReferencePolicy.DYNAMIC)
     private volatile DynamicClassLoaderManager dynamicClassLoaderManager;
 
-    /** Get the dynamic class loader if available */
+    /**
+     * Get the dynamic class loader if available.
+     *
+     * @return the classloader
+     */
     public ClassLoader getDynamicClassLoader() {
         final DynamicClassLoaderManager dclm = this.dynamicClassLoaderManager;
         if (dclm != null) {

Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/NodeUtil.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/NodeUtil.java?rev=1690757&r1=1690756&r2=1690757&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/NodeUtil.java (original)
+++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/NodeUtil.java Mon Jul 13 17:08:18 2015
@@ -35,6 +35,10 @@ public abstract class NodeUtil {
 
     /**
      * Update the mixin node types
+     *
+     * @param node the node
+     * @param mixinTypes the mixins
+     * @throws RepositoryException if the repository's namespaced prefixes cannot be retrieved
      */
     public static void handleMixinTypes(final Node node, final String[] mixinTypes)
     throws RepositoryException {

Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/ObservationListenerSupport.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/ObservationListenerSupport.java?rev=1690757&r1=1690756&r2=1690757&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/ObservationListenerSupport.java (original)
+++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/ObservationListenerSupport.java Mon Jul 13 17:08:18 2015
@@ -95,6 +95,8 @@ public class ObservationListenerSupport
     /**
      * Get a resource resolver.
      * We don't need any syncing as this is called from the process OSGi thread.
+     *
+     * @return the resolver
      */
     public ResourceResolver getResourceResolver() {
         if ( this.resourceResolver == null ) {

Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/Converter.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/Converter.java?rev=1690757&r1=1690756&r2=1690757&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/Converter.java (original)
+++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/Converter.java Mon Jul 13 17:08:18 2015
@@ -32,42 +32,42 @@ public interface Converter {
     /**
      * Convert to Long.
      * @return Long representation of the converted value
-     * @throws NumberFormatException
+     * @throws NumberFormatException if the conversion fails
      */
     Long toLong();
 
     /**
      * Convert to Byte.
      * @return Byte representation of the converted value
-     * @throws NumberFormatException
+     * @throws NumberFormatException if the conversion fails
      */
     Byte toByte();
 
     /**
      * Convert to Short.
      * @return Short representation of the converted value
-     * @throws NumberFormatException
+     * @throws NumberFormatException if the conversion fails
      */
     Short toShort();
 
     /**
      * Convert to Integer.
      * @return Integer representation of the converted value
-     * @throws NumberFormatException
+     * @throws NumberFormatException if the conversion fails
      */
     Integer toInteger();
 
     /**
      * Convert to Double.
      * @return Double representation of the converted value
-     * @throws NumberFormatException
+     * @throws NumberFormatException if the conversion fails
      */
     Double toDouble();
 
     /**
      * Convert to Float.
      * @return Float representation of the converted value
-     * @throws NumberFormatException
+     * @throws NumberFormatException if the conversion fails
      */
     Float toFloat();
 
@@ -94,7 +94,7 @@ public interface Converter {
     /**
      * Convert to BigDecimal.
      * @return BigDecimal representation of the converted value
-     * @throws NumberFormatException
+     * @throws NumberFormatException if the conversion fails
      */
     BigDecimal toBigDecimal();
 

Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/JcrPropertyMapCacheEntry.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/JcrPropertyMapCacheEntry.java?rev=1690757&r1=1690756&r2=1690757&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/JcrPropertyMapCacheEntry.java (original)
+++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/JcrPropertyMapCacheEntry.java Mon Jul 13 17:08:18 2015
@@ -61,6 +61,9 @@ public class JcrPropertyMapCacheEntry {
 
     /**
      * Create a new cache entry from a property.
+     *
+     * @param prop the property
+     * @throws RepositoryException if the provided property cannot be converted to a Java Object
      */
     public JcrPropertyMapCacheEntry(final Property prop)
     throws RepositoryException {
@@ -75,6 +78,9 @@ public class JcrPropertyMapCacheEntry {
 
     /**
      * Create a new cache entry from a value.
+     * @param value the value
+     * @param node the node
+     * @throws RepositoryException if the provided value cannot be stored
      */
     public JcrPropertyMapCacheEntry(final Object value, final Node node)
     throws RepositoryException {
@@ -110,6 +116,10 @@ public class JcrPropertyMapCacheEntry {
      * If the value type is supported directly through a jcr property type,
      * the corresponding value is created. If the value is serializable,
      * it is serialized through an object stream. Otherwise null is returned.
+     *
+     * @param obj the object
+     * @param  node the node
+     * @return the converted value
      */
     private Value createValue(final Object obj, final Node node)
     throws RepositoryException {
@@ -191,7 +201,9 @@ public class JcrPropertyMapCacheEntry {
     /**
      * Convert the default value to the given type
      * @param type The type class
-     * @param session The JCR session
+     * @param node The node
+     * @param dynamicClassLoader The classloader
+     * @param <T> The type
      * @return The converted object
      */
     @SuppressWarnings("unchecked")
@@ -243,7 +255,7 @@ public class JcrPropertyMapCacheEntry {
             final Class<T> type,
             final Node node,
             final ClassLoader dynamicClassLoader)
-    throws ValueFormatException, RepositoryException {
+    throws RepositoryException {
         List<T> values = new ArrayList<T>();
         for (int i = 0; i < sourceArray.length; i++) {
             T value = convertToType(i, sourceArray[i], type, node, dynamicClassLoader);
@@ -264,7 +276,7 @@ public class JcrPropertyMapCacheEntry {
                                 final Class<T> type,
                                 final Node node,
                                 final ClassLoader dynamicClassLoader)
-    throws ValueFormatException, RepositoryException {
+    throws RepositoryException {
         if ( type.isInstance(initialValue) ) {
             return (T) initialValue;
         }

Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResourceIterator.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResourceIterator.java?rev=1690757&r1=1690756&r2=1690757&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResourceIterator.java (original)
+++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResourceIterator.java Mon Jul 13 17:08:18 2015
@@ -60,6 +60,10 @@ public class JcrNodeResourceIterator imp
     /**
      * Creates an instance using the given resource manager and the nodes
      * provided as a node iterator.
+     *
+     * @param resourceResolver the resolver
+     * @param nodes the node iterator
+     * @param helper the helper
      */
     public JcrNodeResourceIterator(final ResourceResolver resourceResolver,
                                    final NodeIterator nodes,
@@ -71,6 +75,12 @@ public class JcrNodeResourceIterator imp
      * Creates an instance using the given resource manager and the nodes
      * provided as a node iterator. Paths of the iterated resources will be
      * concatenated from the parent path, node name and the version number.
+     *
+     * @param resourceResolver the resolver
+     * @param parentPath the parent path
+     * @param parentVersion the parent version
+     * @param nodes the node iterator
+     * @param helper the helper
      */
     public JcrNodeResourceIterator(final ResourceResolver resourceResolver,
                                    final String parentPath,