Sergey Koval wrote:Tim Holloway,
I mean that I want to control method, but while controlling I need to get private variable. I understand how to controll method, but have problems to get this variable and, for example, change it in this method. (In this example I can set value to it by setter method, but in my project there is no setter method for private variable) This is only simply example to say what I want easialy. Do you now understand what I want?
I'm afraid I don't understand what you mean when you say you want to "control method". In Java terminology, execution of the method is done when you "invoke" method, although the more general Computer Science term would be to "call" the method. I'm not sure if that's what you mean, however, since Spring "controls" javabeans, although I wouldn't say that that's controlling their methods.
If a variable is a private variable, it cannot be seen (as an object), read, or changed from any code outside that class. That is not subject to override, since it's part of the definition of the Java language. You can access the private variable using a "get" property method. Or for that matter, any other method internal to the class that wishes to read/write that variable. However, the variable itself remains inaccessible to outsiders.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.