Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

BeanInfo dependency with XMLEncoder

 
sreenath reddy
Ranch Hand
Posts: 415
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

In my application i am using XMLEncoder to seralize the java beans and at the same time each bean has a beaninfo in the classpath . Suppose if my javabean name is abc , my beaninfo class is abcBeanInfo.

But the problem is that as XMLEncoder uses introspector , it gets my beanInfo and writes using this ...because of which i am not able to write few properties of the java bean ...

I want to tell the encoder not to use my BeanInfos.... If there is no BeanInfo actually it creates one on its own , i want to enforce this behaviour ..How to do this ??
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can't you just fix the BeanInfo? A JavaBean, by definition, is a bag of public properties. They shouldn't have private state -- at least not private state that can't be reproduced on demand from the public state.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic