You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by nb...@apache.org on 2003/07/22 20:30:27 UTC

cvs commit: jakarta-velocity-tools/src/java/org/apache/velocity/tools/view ViewToolInfo.java

nbubna      2003/07/22 11:30:27

  Modified:    src/java/org/apache/velocity/tools/view ViewToolInfo.java
  Log:
  make implementation more bean-ish and Digester friendly (use set methods instead of complex constructor)
  
  Revision  Changes    Path
  1.4       +19 -10    jakarta-velocity-tools/src/java/org/apache/velocity/tools/view/ViewToolInfo.java
  
  Index: ViewToolInfo.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity-tools/src/java/org/apache/velocity/tools/view/ViewToolInfo.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ViewToolInfo.java	28 May 2003 00:17:15 -0000	1.3
  +++ ViewToolInfo.java	22 Jul 2003 18:30:27 -0000	1.4
  @@ -77,19 +77,27 @@
       private boolean initializable = false;
   
   
  +    public ViewToolInfo() {}
  +
  +
  +    /***********************  Mutators *************************/
  +
  +    public void setKey(String key)
  +    { 
  +        this.key = key;
  +    }
  +
  +
       /**
  -     * Constructor.  If an instance of the tool cannot be created from
  -     * the classname, it will throw an exception.
  +     * If an instance of the tool cannot be created from
  +     * the classname passed to this method, it will throw an exception.
        *
  -     * @param key the context key for the tool
        * @param classname the fully qualified java.lang.Class of the tool
        */
  -    public ViewToolInfo(String key, String classname) throws Exception
  +    public void setClassname(String classname) throws Exception
       {
  -        this.key = key;
           this.clazz = Class.forName(classname);
  -
  -        //create an instance and see if it is initializable
  +        /* create an instance and see if it is initializable */
           if (clazz.newInstance() instanceof ViewTool)
           {
               this.initializable = true;
  @@ -97,6 +105,8 @@
       }
   
   
  +    /***********************  Accessors *************************/
  +
       public String getKey()
       {
           return key;
  @@ -134,5 +144,4 @@
           return tool;
       }
   
  -
  -}
  \ No newline at end of file
  +}
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org