commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Juozas Baliuka" <bali...@centras.lt>
Subject Re: [lang] Proposal for *NEXT* version
Date Fri, 04 Oct 2002 06:22:28 GMT

<snip>
>    public class MyClass {
>      private int fAge;
>      private String fName;
>
>      static {
>        BeanInfoUtils.expose(MyClass.class, "name", "fName",
> "setNameWithValidation");
>        BeanInfoUtils.expose(MyClass.class, "age", "fAge", "fAge");
>      }
>
>      private void setNameWithValidation(String name) {..}
>    }
>
> Then, the properties can be accessed by PropertyUtils:
>
>    PropertyUtils.setProperty(myObj, "name", "John Yu");
>    PropertyUtils.setProperty(myObj, "age", new Integer(42));
>
> Comment?

As I see "MyClass" has no public methods and fields and  "PropertyUtils"
must be used
to manipulate properties. I is meaningful if bean is used from some
scripting language,
but I do not like to type things like this in JAVA. I think the best
solution to implement some
compiler, like aspectj did.

<snip>


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