• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

java beans propertyDescrptor

 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have code like following




It turns out that for the "enrollDay" field , the "PropertyDescriptor " can NOT find its write method. For the rest of fields, it has no problem in terms of converting the string inot int, etc. So is it true that , in order to make this work, you can only do straightford setter method without any twisting around it ?

 
Bartender
Posts: 4179
22
IntelliJ IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you be more specific about the problem you are having? Also a real compilable example would help demonstrate the problem.

Is the problem because you have a different return type for the getter than you have parameter for the setter (can't tell, you conveniently left off the return types for your methods)?

The method pair for a property, of type T must be:

It does not matter what the value is stored as in the bean - the Introspector uses methods to determine Bean properties. My guess is that you messed up one of the method signatures. You can get around this requirement (I think) by writing your own BeanInfo class which knows what methods to call...
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic