Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Custom/Value Objects with Java Bean

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey All,

this is actaully a commons beanutil question but hoping this forum is a good spot for it.

I have a problem with custom objects and java beans

e.g.

class MyCustomNumber
{
}

class MyJavaBean
{
private MyCustomNumber someProp;
//getter and setter
}

I am having allot of difficult in working with custom objects and binding them using commons bean.

PropertyUtils doesn't seem to have type conversion, so i looked into BeanUtils

However the problem I have, some of my properties are collections, but BeanUtils.getProperty() converts everything to a string ( very anoying )

I need to use BeanUtils.setProperty() so I can do the type conversion, but it just doesn't seem right to

set properties using BeanUtils.setProperty() and
get properties using PropertyUtils.getProperty() just so I can support custom value objects and collections as bean properties.

Can anyone give me some advice?
 
The overall mission is to change the world. When you've done that, then you can read this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!