Menu

#10 IntrospectionException for Object data member.

open
nobody
None
5
2006-10-12
2006-10-12
maryr
No

I've got a generic class which handles multiple data
types, I've got a 2nd data member to tell me the type.

Object oValue = null;
int iDBDataType = java.sql.Types.OTHER;

My getter and setter for oValue treats the data type as
an Object:

public Object getOValue() {return oValue; }
public void setOValue(Object oValue) { this.oValue =
oValue;}

The problem is in JoxUtils.needsClassName(Object ob,
Class propClass)

The following code:
if (ob instanceof String) return false;

Should be changed to something like this:
Class obClass = ob.getClass();
if (ob instanceof String && propClass != null &&
obClass.equals(propClass))
return false;

This way it'll return true if the data is a String, but
the data member is not a String.
This way I won't get an error when going from XML file
to Java bean.

IntrospectionException: java.lang.Object not
superclass of java.lang.Object

Discussion


Log in to post a comment.

Monday.com Logo