Juozas, ----- Original Message ----- From: "Juozas Baliuka" <[EMAIL PROTECTED]> To: "Jakarta Commons Developers List" <[EMAIL PROTECTED]> Sent: Saturday, November 09, 2002 4:02 PM Subject: Re: [clazz] draft reflect implementation
> Hi, > API looks very good, I want to add this: Thank you, > 1. > /** > * Creates a new instance of this Clazz using the supplied parameters > */ > public abstract Object newInstance(Object[] parameters); > > some of parameters can be null and this method must be something like this : > > public abstract Object newInstance( Class types[], Object[] parameters); Makes sense. > 2. > I think we need some kind of callback in ClazzProperty "property change > listener" Are you talking about event handling a la java.beans.BeanDescriptor? > 3. ClazzOperation needs some descriptors for exeptions Sure. Will do. > Is ClazzOperation is for public methods only ? > I am not sure, but I thinkit is better to throw "checked" exeption from > "invoke" and "newInstance" Sure. Makes sense. Something like ClazzInvocationTargetException. - Dmitri > > > ----- Original Message ----- > From: "Dmitri Plotnikov" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Friday, November 08, 2002 3:33 PM > Subject: [clazz] draft reflect implementation > > > > I am not really done with the first draft yet, but since I will have to > > take about a week off from clazz, I wanted to commit what > > I have done so far and give you a chance to look it over. > > > > My initial focus was on implementing functionality equivalent to > > that of java.beans.Introspector. There are several pretty cool > > improvements over the Introspector: > > > > 1. Highly customizable design. > > > > - You can add new ClazzLibraries for new kinds of Clazzes. So far > > there is only one such library, ReflectClazzLibrary, but more are > > coming. > > > > - You can add new ClazzLoaders to customize Clazz generation for > > individual clazzes or groups of clazzes. > > > > - In the case of Reflected clazzes, you can change the way accessor > > methods are bound to properties. For example, if you want to make > > read methods look like "readFoo()" instead of "getFoo()", it is a matter > > of overriding one method on ReflectScalarPropertyIntrospector. > > > > - In the case of Reflected clazzes, you can add new categories of > > properties. The default list of categories consists of List (which > > works for Lists as well as arrays), Mapped and Scalar properties. > > > > 2. In the case of ReflectedClazzes, richer mapping of accessors to > > properties: methods like getFoo(int), setBar(key,value), getFooKeySet() > > etc are recognized. > > > > 3. If a property is Mapped, the corresponding clazzProperty.get() > > returns a Map, even if all the bean defines is a bunch of accessor > > methods like getFoo(key). The Map implementation returned by > > clazzProperty will invoke those accessors if they exist (see the > > ReflectedMap). > > > > 4. Similarly, if a property is a List or an array, the corresponding > > value is a List (see ReflectedList). > > > > 5. Powerful diagnostic facility that optionally prints details of > > introspection. You won't have to wonder any more: "how come it does > > not see my property 'foo'". I have attached a sample diagnostic log. > > Check it out, it's pretty cool. > > > > The implemented functionality comes with tests, but as you will see not > > all functionality is implemented yet. > > > > Don't look for ATTRIBUTES, DELEGATORS or BEAN stuff yet - I'll get to > > that in a week or so. > > > > > > - Dmitri -- To unsubscribe, e-mail: <mailto:commons-dev-unsubscribe@;jakarta.apache.org> For additional commands, e-mail: <mailto:commons-dev-help@;jakarta.apache.org>
