• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problems with java.beans.*;

 
Rafael Afonso
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello:
I was seeing some classes from java.beans.*package, more specificly Expression and Statement classes. This pagefrom Java Almanac shows how gets getters and setters methods using these classes.
So, I created a test class. In this class I try to use getters and setters from a Internal class, a external class but in same java file than test class and a external class in another java file.
It follows the code from test class:

Now external class code:

Well, I runned this test class and I got this:

java.lang.NoSuchMethodException: TestaStatement$InnerClass0.setValue(Integer0);
at java.beans.Statement.invoke(Statement.java:489)
at java.beans.Statement.execute(Statement.java:119)
at TestaStatement.executeSetter(TestaStatement.java:11)
at TestaStatement.testInnerClass(TestaStatement.java:26)
at TestaStatement.main(TestaStatement.java:72)
java.lang.NoSuchMethodException: <unbound>=TestaStatement$InnerClass0.getValue();
at java.beans.Statement.invoke(Statement.java:489)
at java.beans.Statement.execute(Statement.java:119)
at TestaStatement.executeGetter(TestaStatement.java:17)
at TestaStatement.testInnerClass(TestaStatement.java:32)
at TestaStatement.main(TestaStatement.java:72)
java.lang.NoSuchMethodException: OuterClass0.setValue(Integer1);
at java.beans.Statement.invoke(Statement.java:489)
at java.beans.Statement.execute(Statement.java:119)
at TestaStatement.executeSetter(TestaStatement.java:11)
at TestaStatement.testOuterClass(TestaStatement.java:42)
at TestaStatement.main(TestaStatement.java:73)
java.lang.NoSuchMethodException: <unbound>=OuterClass0.getValue();
at java.beans.Statement.invoke(Statement.java:489)
at java.beans.Statement.execute(Statement.java:119)
at TestaStatement.executeGetter(TestaStatement.java:17)
at TestaStatement.testOuterClass(TestaStatement.java:48)
at TestaStatement.main(TestaStatement.java:73)
java.lang.NoSuchMethodException: ExternClass0.setValue(Integer2);
at java.beans.Statement.invoke(Statement.java:489)
at java.beans.Statement.execute(Statement.java:119)
at TestaStatement.executeSetter(TestaStatement.java:11)
at TestaStatement.testExternClass(TestaStatement.java:58)
at TestaStatement.main(TestaStatement.java:74)
java.lang.NoSuchMethodException: <unbound>=ExternClass0.getValue();
at java.beans.Statement.invoke(Statement.java:489)
at java.beans.Statement.execute(Statement.java:119)
at TestaStatement.executeGetter(TestaStatement.java:17)
at TestaStatement.testExternClass(TestaStatement.java:64)
at TestaStatement.main(TestaStatement.java:74)

I do not understand why beans are called "TestaStatement$InnerClass0", "OuterClass0" e "ExternClass0". Where did this "0" come? Did I do something wrong in my code. What do you think?
Thanks,
 
Jason Menard
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm going to move this to Java in General (beginner).
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm afraid this one's a might' bit too complicated for us simple folk. For us, beans is somethin' we eat out of a can. Sometimes they're hot. Sometimes they're cold.
I'm moving this on over to the Intermediate forum. Hopefully, some fancy talkers there can give you a hand.
[ August 17, 2003: Message edited by: Dirk Schreckmann ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic