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 Fri, 23 Aug 2002 02:50:11 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 jwseach@yahoo.com  2002-08-23 02:50 -------
Daniel, when I first read your email about the wrapper, I didn't understand 
what you were getting at, but I think I do now.  In other words, create a 
wrapper class something like:

public class StaticClassWrapper {
    private Class userClass;

    public StaticClassWrapper(Class userClass) {
        this.userClass = userClass;
    }

    public StaticClassWrapper(String className) throws ClassNotFoundException {
        this(Class.forName(className));
    }

    public Class getUserClass() {
        return userClass;
    }
}

check for that class in UberspectImpl.getMethod(), and pass its wrapped class 
to the introspecter, rather than checking for java.lang.Class and using that 
object as I had suggested earlier.

Taking it one step further, if we anticipate that others may have a need to 
extend this class, we may want to define an interface, a default wrapper class 
implementing that interface, and a way to override which wrapper class to look 
for with a configuration option, as you suggested.  (Of course, we could always 
just make the class final and privatize all the methods in order to avoid the 
maintenance headaches :-)

If one of the committers thinks this is a reasonable approach, I can try to 
implement it and post a patch this weekend.  Let me know.

--
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