You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@velocity.apache.org by di...@apache.org on 2012/07/03 17:14:30 UTC

svn commit: r1356781 - /velocity/sandbox/jsr223/velocity-engine-scripting/src/main/java/org/apache/velocity/script/VelocityScriptEngineFactory.java

Author: dishara
Date: Tue Jul  3 15:14:29 2012
New Revision: 1356781

URL: http://svn.apache.org/viewvc?rev=1356781&view=rev
Log:
Adding comments to VelocityEngineFactory

Modified:
    velocity/sandbox/jsr223/velocity-engine-scripting/src/main/java/org/apache/velocity/script/VelocityScriptEngineFactory.java

Modified: velocity/sandbox/jsr223/velocity-engine-scripting/src/main/java/org/apache/velocity/script/VelocityScriptEngineFactory.java
URL: http://svn.apache.org/viewvc/velocity/sandbox/jsr223/velocity-engine-scripting/src/main/java/org/apache/velocity/script/VelocityScriptEngineFactory.java?rev=1356781&r1=1356780&r2=1356781&view=diff
==============================================================================
--- velocity/sandbox/jsr223/velocity-engine-scripting/src/main/java/org/apache/velocity/script/VelocityScriptEngineFactory.java (original)
+++ velocity/sandbox/jsr223/velocity-engine-scripting/src/main/java/org/apache/velocity/script/VelocityScriptEngineFactory.java Tue Jul  3 15:14:29 2012
@@ -26,12 +26,44 @@ import java.util.List;
 
 public class VelocityScriptEngineFactory implements ScriptEngineFactory {
 
+    /**
+     *  names of the script engine
+     */
     private List<String> names;
+
+
+    /**
+     * List of  extensions for script engine
+     */
     private List<String> extensions;
+
+
+    /**
+     *  List of mime types for script engine
+     */
     private List<String> mimeTypes;
+
+    /**
+     *  Default name of the engine
+     */
     private String name = "velocity";
+
+
+    /**
+     * Default version of the engine
+     */
     private String version = "1.8";
+
+
+    /**
+     *  Default script language name
+     */
     private String langName = "velocity";
+
+
+    /**
+     * Default  version of the script language
+     */
     private String langVersion = "1.8";
 
 
@@ -72,6 +104,7 @@ public class VelocityScriptEngineFactory
         initDefaultSettings();
     }
 
+
     /**
      * Simple Factory with all default settings
      */
@@ -90,34 +123,77 @@ public class VelocityScriptEngineFactory
         mimeTypes = Collections.unmodifiableList(mimeTypes);
     }
 
+
+  /**
+     *  Returns the full name of the ScriptEngine.
+     * @return
+     */
     public String getEngineName() {
         return name;
     }
 
+
+  /**
+     *  Returns the version of the ScriptEngine.
+     * @return
+     */
     public String getEngineVersion() {
         return version;
     }
 
+
+  /**
+     *  Returns an immutable list of filename extensions, which generally identify scripts written in the language
+     *  supported by this ScriptEngine.
+     * @return
+     */
     public List<String> getExtensions() {
         return extensions;
     }
 
+
+  /**
+     *  Returns an immutable list of mimetypes, associated with scripts that can be executed by the engine.
+     * @return
+     */
     public List<String> getMimeTypes() {
         return mimeTypes;
     }
 
+
+  /**
+     * Returns an immutable list of short names for the ScriptEngine, which may be used to identify the ScriptEngine by the ScriptEngineManager.
+     * @return
+     */
     public List<String> getNames() {
         return names;
     }
 
+
+  /**
+     *  Returns the name of the scripting langauge supported by this ScriptEngine.
+     * @return
+     */
     public String getLanguageName() {
         return langName;
     }
 
+
+  /**
+     *  Returns the version of the scripting language supported by this ScriptEngine.
+     * @return
+     */
     public String getLanguageVersion() {
         return langVersion;
     }
 
+
+
+   /**
+     *   Returns the value of an attribute whose meaning may be implementation-specific.
+     * @param s
+     * @return
+     */
     public Object getParameter(String s) {
         if (s.equals(ScriptEngine.ENGINE)) {
             return getEngineName();
@@ -136,6 +212,8 @@ public class VelocityScriptEngineFactory
         }
     }
 
+
+
     /**
      *
      * @param s   Name of the Object to whom the method belongs to
@@ -164,6 +242,8 @@ public class VelocityScriptEngineFactory
         return syntax.toString();
     }
 
+
+
     /**
      *
      * @param s  String to display
@@ -190,8 +270,9 @@ public class VelocityScriptEngineFactory
         return output.toString();
     }
 
-    /**
-     *
+
+  /**
+     *   Returns A valid scripting language executable progam with given statements.
      * @param strings  scripting statements provided
      * @return the program from the statements given
      */
@@ -204,6 +285,10 @@ public class VelocityScriptEngineFactory
         return program.toString();
     }
 
+    /**
+     *  Returns an instance of the ScriptEngine associated with this ScriptEngineFactory
+     * @return
+     */
     public ScriptEngine getScriptEngine() {
         return new VelocityScriptEngine(this);
     }