velocity-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 11924] - Add Support for Static Utility Classes
Date Sun, 25 Aug 2002 08:48:52 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11924>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11924

Add Support for Static Utility Classes





------- Additional Comments From baliuka@mwm.lt  2002-08-25 08:48 -------
I like "StaticClassWrapper" idea, namespace stuff can be implemented this
way too, StaticClassWrapper can be container for static methods :

public StaticClassWrapper  defineNamespace( String name ){
 
    StaticClassWrapper namespace = new StaticClassWrapper();
   
        put( name, namespace );     
        
        return namespace;
      
}

public class StaticClassWrapper{

 List methods = new Vector();

 public StaticClassWrapper  add( Class c ){

      copyStaticMethods( methods, c.getMethods()  );

   return this;
 }
..........................

}

methods can be added/removed this way and used like :

 $math.sin(2)
 $math.median($var)

some reserved name can be used for "global" methods.

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


Mime
View raw message