commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Rall <...@finemaltcoding.com>
Subject Re: StringUtils constructor is private
Date Mon, 12 Aug 2002 23:14:09 GMT
"Craig R. McClanahan" <craigmcc@apache.org> writes:

> On 12 Aug 2002, Daniel Rall wrote:
> 
> > Velocity will invoke static methods on an instance, just as Java will.
> 
> But Velocity apparently *requires* an instance in order to do this,
> whereas Java doesn't.

Actually, Java does require an instance to perform introspection
(which was Velocity's original and current default mode of operation).
Note that this differs from vanilla reflection, which is used under
the covers, but is not part of Velocity's "interface".

> Call it a restriction instead of a flaw if you want; it's a requirement
> imposed by Velocity on classes whose static methods it wants to access.

Yes.  JavaBean-style introspection doesn't work without an instance to
introspect.  IMHO, anyone who wants this Velocity behavior changed
should plug in their own uberspector/introspector combination.
-- 

Daniel Rall <dlr@finemaltcoding.com>

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


Mime
View raw message