Why not use javax.beans.Introspector, which exists specifically to find properties of beans?
On 25/4/02 6:11 pm, "Yura Cangea" <[EMAIL PROTECTED]> wrote: > Hello Jim, > > Jim, of course I know how it decides what should be considered as a > property since I implemented that functionality, here below I will try to > explain the way it works: > > Note that in the context below by "Getter" I mean a method whose name > starts with "get" followed by an uppercase character, has a > non "void" return type and doesn't have parameters (indexed getters/setters > are > not supported), and by "Setter" I mean a method whose name starts > with "set", followed by an uppercase character, has "void" as it's > return type and has a single parameter. "Getter" and "Setter" for the same > property must have the same property name, for example > "getSomeInformation/setSomeInformation", property name for those is > "someInformation". > > There are several cases: > > 1) Field, Getter and Setter exist > > If Getter's return type matches field's type and Setter's > parameter type also matches field's type a property is being formed. > > 2) Field and a getter or setter exist > > Same rule as for (1) but only for existent Getter or Setter. > > 3) Getter and Setter exists (no field) > > If Setter's parameter type matches Getter's return type a property > is being formed. > > 4) Only Getter or Setter exists (no field) > > A property is being formed. > > 5) Only a field exists with no getter/setter > > No property is formed. > > Best regards, > Yura Cangea > ---------------------------------- > JetBrains, Inc / IntelliJ Software > http://www.intellij.com > "Develop with pleasure" > ---------------------------------- > > ----- Original Message ----- > From: Jim Freeman [ mailto:[EMAIL PROTECTED] ] > Sent: Thursday, April 25, 2002 8:34:58 PM > Subject: [Eap-list] "P" in Structure view? > >> Yura, >> Do you know how it decides that a method is a getter/setter for a >> property? Some of the methods it marks as P aren't getting/setting a >> class property. > >> Jim > >> -----Original Message----- >> From: Yura Cangea [mailto:[EMAIL PROTECTED]] >> Sent: Thursday, April 25, 2002 5:06 AM >> To: Jim Freeman >> Subject: Re[2]: [Eap-list] "P" in Structure view? > >> Hello Jim, > >> It doesn't matter how much code a getter/setter has in it as long as >> its signature conforms to getter/setter signature for a property. > >> Best regards, >> Yura Cangea >> ---------------------------------- >> JetBrains, Inc / IntelliJ Software >> http://www.intellij.com >> "Develop with pleasure" >> ---------------------------------- > >> ----- Original Message ----- >> From: Jim Freeman [ mailto:[EMAIL PROTECTED] ] >> Sent: Thursday, April 25, 2002 2:04:26 AM >> Subject: [Eap-list] "P" in Structure view? > >>> That's what I suspected. It must be broken (build 616), as it appears >>> to also take get/set methods that are not simple property get sets and >>> show them as P methods. Some of these methods have 50 lines of code >> in >>> them, and (just because the name starts with 'get' or 'set'?), it's >>> showing them as P methods. > >>> Jim > >>> -----Original Message----- >>> From: Ian Pojman [mailto:[EMAIL PROTECTED]] >>> Sent: Wednesday, April 24, 2002 1:01 PM >>> To: [EMAIL PROTECTED] >>> Subject: Re: [Eap-list] "P" in Structure view? > >>> Property > >>> get/setProperty > >>> On Wednesday, April 24, 2002, at 02:12 PM, Zabel, Ian wrote: > >>> it basically gives you a "bean-like" view. if you have gets/sets for >> any >>> properties of the class, the P button will show you the properties, >> with >>> their accessor methods grouped underneath them. if you turn the P off, >>> you just see the get and set methods as normal methods. > >>> Ian. > >>> -----Original Message----- >>> From: Jim Freeman [mailto:[EMAIL PROTECTED]] >>> Sent: Wednesday, April 24, 2002 3:06 PM >>> To: Eap-List (E-mail) >>> Subject: [Eap-list] "P" in Structure view? > >>> In the Structure view pane, what does a "P" in the purple circle mean? > >>> Some public methods are marked with M, some with P. The ones marked >>> with P have the method name only visible if you expand the P. > >>> Jim > >>> _______________________________________________ >>> Eap-list mailing list >>> [EMAIL PROTECTED] >>> http://www.intellij.com/mailman/listinfo/eap-list > > >> _______________________________________________ >> Eap-list mailing list >> [EMAIL PROTECTED] >> http://www.intellij.com/mailman/listinfo/eap-list > > > >> _______________________________________________ >> Eap-list mailing list >> [EMAIL PROTECTED] >> http://www.intellij.com/mailman/listinfo/eap-list > > > _______________________________________________ > Eap-list mailing list > [EMAIL PROTECTED] > http://www.intellij.com/mailman/listinfo/eap-list _______________________________________________ Eap-list mailing list [EMAIL PROTECTED] http://www.intellij.com/mailman/listinfo/eap-list
