commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ola Berg <ola.b...@arkitema.se>
Subject Re: [lang] 1.0 release foci
Date Wed, 14 Aug 2002 08:00:54 GMT
Hen writes:

>I\'ve pushed the ClassUtils class back into the Lang cvs tree for
>consideration. Methods are:

>    public static java.lang.Object createObject(java.lang.String);
>    public static java.lang.Object createObject(java.lang.Class);
>    public static boolean classExists(java.lang.String);
>    public static java.lang.Class getClass(java.lang.String);
>    public static boolean classInstanceOf(java.lang.Class, java.lang.String);
>    public static boolean classImplements(java.lang.Class, java.lang.String);
>    public static boolean classExtends(java.lang.Class, java.lang.String);	

In a bunch of code I gave Stephen, the questions answered in the boolean methods of your interface
are implemented as separate Predicate\'s. General util classes for Class, Method, Field, Member
etc can take such Predicates and filter out the relevant. So one can create a Predicate that
evaluate()s to true for \"class whose name begins with Foo that is somewhere in the org.apache
structure that implements Bazilizable and has a protected static method with three parameters\"
or anything.

This semi-architecture was intended to go in some kind of [reflect] package. If [lang] should
do ClassUtils and FileUtils kind of stuff, as in your interface, i suggest that the predicate
based architecture goes into lang. 

(Or thinking about it, in the block I sent to Stephen, the Class predicates was not implemented.
But they should work in this way)

/O

--------------------
ola.berg@arkitema.se
0733 - 99 99 17

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