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/14 14:01:52 UTC

svn commit: r1690908 - in /sling/trunk/bundles/scripting/javascript/src/main/java/org/apache/sling/scripting/javascript: RhinoHostObjectProvider.java SlingWrapper.java helper/SlingGlobal.java io/EspReader.java wrapper/ScriptableResource.java

Author: radu
Date: Tue Jul 14 12:01:52 2015
New Revision: 1690908

URL: http://svn.apache.org/r1690908
Log:
trivial: corrected JavaDoc to comply with Java 1.8

Modified:
    sling/trunk/bundles/scripting/javascript/src/main/java/org/apache/sling/scripting/javascript/RhinoHostObjectProvider.java
    sling/trunk/bundles/scripting/javascript/src/main/java/org/apache/sling/scripting/javascript/SlingWrapper.java
    sling/trunk/bundles/scripting/javascript/src/main/java/org/apache/sling/scripting/javascript/helper/SlingGlobal.java
    sling/trunk/bundles/scripting/javascript/src/main/java/org/apache/sling/scripting/javascript/io/EspReader.java
    sling/trunk/bundles/scripting/javascript/src/main/java/org/apache/sling/scripting/javascript/wrapper/ScriptableResource.java

Modified: sling/trunk/bundles/scripting/javascript/src/main/java/org/apache/sling/scripting/javascript/RhinoHostObjectProvider.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/scripting/javascript/src/main/java/org/apache/sling/scripting/javascript/RhinoHostObjectProvider.java?rev=1690908&r1=1690907&r2=1690908&view=diff
==============================================================================
--- sling/trunk/bundles/scripting/javascript/src/main/java/org/apache/sling/scripting/javascript/RhinoHostObjectProvider.java (original)
+++ sling/trunk/bundles/scripting/javascript/src/main/java/org/apache/sling/scripting/javascript/RhinoHostObjectProvider.java Tue Jul 14 12:01:52 2015
@@ -32,9 +32,9 @@ public interface RhinoHostObjectProvider
      * <code>Scriptable</code> interface. These classes will be registered
      * with the global scope as host objects and may then be used in any
      * server-side ECMAScript scripts.
-     * <p>
-     * Implementations may return <code>null</code> instead of an empty array
-     * if they do not provide any host objects.
+     *
+     * @return the host object classes; may return <code>null</code> instead of an empty array for implementations that do not provide
+     * any host objects
      */
     Class<? extends Scriptable>[] getHostObjectClasses();
 
@@ -50,9 +50,9 @@ public interface RhinoHostObjectProvider
      * <code>org.slf4j.Log</code> as an imported class, it may simply be
      * referred to as <code>Log</code> (provided there is no other object of
      * that name, of course).
-     * <p>
-     * Implementations may return <code>null</code> instead of an empty array
-     * if they do not provide any imported classes.
+     *
+     * @return the imported classes; may return <code>null</code> instead of an empty array for implementations that do not import any
+     * classes
      */
     Class<?>[] getImportedClasses();
 
@@ -75,6 +75,8 @@ public interface RhinoHostObjectProvider
      * <p>
      * Implementations may return <code>null</code> instead of an empty array
      * if they do not provide any package names.
+     *
+     * @return the imported packages; may return <code>null</code> instead of an empty array for implementations that do import any packages
      */
     String[] getImportedPackages();
 }

Modified: sling/trunk/bundles/scripting/javascript/src/main/java/org/apache/sling/scripting/javascript/SlingWrapper.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/scripting/javascript/src/main/java/org/apache/sling/scripting/javascript/SlingWrapper.java?rev=1690908&r1=1690907&r2=1690908&view=diff
==============================================================================
--- sling/trunk/bundles/scripting/javascript/src/main/java/org/apache/sling/scripting/javascript/SlingWrapper.java (original)
+++ sling/trunk/bundles/scripting/javascript/src/main/java/org/apache/sling/scripting/javascript/SlingWrapper.java Tue Jul 14 12:01:52 2015
@@ -24,12 +24,16 @@ import org.mozilla.javascript.Wrapper;
 public interface SlingWrapper extends Wrapper {
 
     /**
-     * The name of the JavaScript host object "class"
+     * The name of the JavaScript host object "class".
+     *
+     * @return the class name
      */
     String getClassName();
     
     /**
-     * The list of Java classes wrapped by this wrapper
+     * The list of Java classes wrapped by this wrapper.
+     *
+     * @return the wrapped classes
      */
     Class<?> [] getWrappedClasses();
     

Modified: sling/trunk/bundles/scripting/javascript/src/main/java/org/apache/sling/scripting/javascript/helper/SlingGlobal.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/scripting/javascript/src/main/java/org/apache/sling/scripting/javascript/helper/SlingGlobal.java?rev=1690908&r1=1690907&r2=1690908&view=diff
==============================================================================
--- sling/trunk/bundles/scripting/javascript/src/main/java/org/apache/sling/scripting/javascript/helper/SlingGlobal.java (original)
+++ sling/trunk/bundles/scripting/javascript/src/main/java/org/apache/sling/scripting/javascript/helper/SlingGlobal.java Tue Jul 14 12:01:52 2015
@@ -49,7 +49,6 @@ import org.slf4j.LoggerFactory;
  * The <code>SlingGlobal</code> class provides two interesting new global
  * functions which are not part of the ECMAScript standard but which are
  * available in the Rhino Shell and which may be of use by JavaScripts:
- * <p>
  * <dl>
  * <dt><code>print(args, ...)</code></dt>
  * <dd>Prints the arguments <code>args</code> in a single message to the scripts

Modified: sling/trunk/bundles/scripting/javascript/src/main/java/org/apache/sling/scripting/javascript/io/EspReader.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/scripting/javascript/src/main/java/org/apache/sling/scripting/javascript/io/EspReader.java?rev=1690908&r1=1690907&r2=1690908&view=diff
==============================================================================
--- sling/trunk/bundles/scripting/javascript/src/main/java/org/apache/sling/scripting/javascript/io/EspReader.java (original)
+++ sling/trunk/bundles/scripting/javascript/src/main/java/org/apache/sling/scripting/javascript/io/EspReader.java Tue Jul 14 12:01:52 2015
@@ -38,18 +38,18 @@ import org.slf4j.LoggerFactory;
  * <li>ECMA code is written to the output as is.
  * <li>ECMA slash star (/*) comments are also written as is.
  * <li>ECMA slash slash (//) comments are written as is.
- * <li>JSP style template comments (<%-- -->) are also removed from the
+ * <li>JSP style template comments (&lt;%-- --&gt;) are also removed from the
  * stream. Lineendings (LFs and CRLFs) are written, though.
- * <li>HTML comments (<!-- -->) are not treated specially. Rather they are
+ * <li>HTML comments (&lt;!-- --&gt;) are not treated specially. Rather they are
  * handled as plain template text written to the output wrapped in
- * out.write(). The consequence of this behavious is, that as in JSP ECMA
+ * out.write(). The consequence of this behaviour is, that as in JSP ECMA
  * expressions may be included within the comments.
  * </ul>
  * <p>
  * The nice thing about this reader is, that the line numbers of the resulting
  * stream match the line numbers of the matching contents of the input stream.
  * Due to the insertion of write() calls, column numbers will not necessarily
- * match, though. This is especially true if you mix ECMA code tags (<% %>)
+ * match, though. This is especially true if you mix ECMA code tags (&lt;% %&gt;)
  * with template text on the same line.
  * <p>
  * For maximum performance it is advisable to not create the EspReader with a
@@ -197,6 +197,8 @@ public class EspReader extends FilterRea
      * constructor wraps the input reader with a <code>PushbackReader</code>,
      * so that input stream modifications may be handled transparently by our
      * {@link #doRead()} method.
+     *
+     * @param baseReader the wrapped reader
      */
     public EspReader(Reader baseReader) {
         super(baseReader);
@@ -211,7 +213,11 @@ public class EspReader extends FilterRea
         pushState(PARSE_STATE_ESP);
     }
     
-    /** Set the code fragment used to initialize the "out" variable */
+    /**
+     * Set the code fragment used to initialize the "out" variable
+     *
+     * @param statement the statement used for initialization
+     */
     public void setOutInitStatement(String statement) {
         outInitStatement = statement;
     }

Modified: sling/trunk/bundles/scripting/javascript/src/main/java/org/apache/sling/scripting/javascript/wrapper/ScriptableResource.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/scripting/javascript/src/main/java/org/apache/sling/scripting/javascript/wrapper/ScriptableResource.java?rev=1690908&r1=1690907&r2=1690908&view=diff
==============================================================================
--- sling/trunk/bundles/scripting/javascript/src/main/java/org/apache/sling/scripting/javascript/wrapper/ScriptableResource.java (original)
+++ sling/trunk/bundles/scripting/javascript/src/main/java/org/apache/sling/scripting/javascript/wrapper/ScriptableResource.java Tue Jul 14 12:01:52 2015
@@ -51,6 +51,7 @@ import org.slf4j.LoggerFactory;
  * <li>[Resource[]] getChildren()</li>
  * <li>[Resource[]] listChildren()</li>
  * <li>[Boolean] isResourceType(String)</li>
+ * </ul>
  */
 public class ScriptableResource extends ScriptableObject implements
         SlingWrapper {
@@ -74,28 +75,28 @@ public class ScriptableResource extends
         this.resource = (Resource) res;
     }
 
-    /**
+    /*
      * Maps getName() method as name property.
      */
     public String jsGet_name() {
         return this.jsFunction_getName();
     }
 
-    /**
+    /*
      * Maps getName() method as getName() method.
      */
     public String jsFunction_getName() {
         return resource.getName();
     }
 
-    /**
+    /*
      * Maps getPath() method as path property.
      */
     public String jsGet_path() {
         return this.jsFunction_getPath();
     }
 
-    /**
+    /*
      * Maps getPath() method as getPath() method.
      */
     public String jsFunction_getPath() {
@@ -108,20 +109,21 @@ public class ScriptableResource extends
      * property.
      *
      * @deprecated since 2.1.0 because it maps the method name incorrectly.
+     * @return the resource type
      */
     @Deprecated
     public String jsGet_type() {
         return this.jsFunction_getResourceType();
     }
 
-    /**
+    /*
      * Maps getResourceType() to resourceType property.
      */
     public String jsGet_resourceType() {
         return this.jsFunction_getResourceType();
     }
 
-    /**
+    /*
      * Maps getResourceType() to the getResourceType() method.
      */
     public String jsFunction_getResourceType() {
@@ -136,28 +138,28 @@ public class ScriptableResource extends
         return new NativeArray(IteratorUtils.toArray(resource.listChildren()));
     }
 
-    /**
+    /*
      * Maps getParent() method as parent property.
      */
     public Object jsGet_parent() {
         return this.jsFunction_getParent();
     }
 
-    /**
+    /*
      * Maps getParent() method as getParent() method.
      */
     public Object jsFunction_getParent() {
         return resource.getParent();
     }
 
-    /**
+    /*
      * Maps getResourceSuperType() to resourceSuperType property.
      */
     public String jsGet_resourceSuperType() {
         return this.jsFunction_getResourceSuperType();
     }
 
-    /**
+    /*
      * Maps getResourceSuperType() to the getResourceSuperType() method.
      */
     public String jsFunction_getResourceSuperType() {
@@ -174,13 +176,14 @@ public class ScriptableResource extends
      * property.
      *
      * @deprecated since 2.1.0 because it maps the method name incorrectly.
+     * @return the resource metadata
      */
     @Deprecated
     public Object jsGet_meta() {
         return jsFunction_getResourceMetadata();
     }
 
-    /**
+    /*
      * Maps getResourceMetadata() to resourceMetadata property.
      */
     public Object jsGet_resourceMetadata() {
@@ -193,27 +196,28 @@ public class ScriptableResource extends
      * getResourceMetadata() method.
      *
      * @deprecated since 2.1.0 because the method is named incorrectly.
+     * @return the resource metadata
      */
     @Deprecated
     public Object jsFunction_getMetadata() {
         return jsFunction_getResourceMetadata();
     }
 
-    /**
+    /*
      * Maps getResourceMetadata() to getResourceMetadata method.
      */
     public Object jsFunction_getResourceMetadata() {
         return toJS(resource.getResourceMetadata());
     }
 
-    /**
+    /*
      * Maps getResourceResolver() to resourceResolver property.
      */
     public Object jsFunction_getResourceResolver() {
         return toJS(resource.getResourceResolver());
     }
 
-    /**
+    /*
      * Maps getResourceResolver() to getResourceResolver method.
      */
     public Object jsGet_resourceResolver() {
@@ -230,11 +234,11 @@ public class ScriptableResource extends
         return resource.getChild(childPath);
     }
 
-    /**
+    /*
      * Helper method to easily retrieve the default adapted object of the
      * resource. In case of Object Content Mapping support, this method will
      * return the correctly mapped content object for this resource.
-     * <p>
+     *
      * Calling this method is equivalent to calling the adaptTo method with the
      * argument "java.lang.Object".
      */