English 中文(简体)
1. 没有源代码的班级替代方法
原标题:Substitute methods in class without source code
  • 时间:2012-04-13 19:44:19
  •  标签:
  • java

我有几类<代码>A,无源代码,本类使用某些类别<代码>B,有2种方法,如<代码>#get(:t 和 #set(int Value):空白 <>标准> Java Library!

曼 谷 我替代这2种方法或所有类别,以改变这一类功能<代码>。 A。

For example, this class A uses standard class B for saving some information, but I want uses this another container for some operations. It possible?

最佳回答

您可使用一些密码操纵图书馆,如java-bytecode-asm。 然而,更简单的办法是使用rt.jar)。

问题回答

I am not sure but I believe what you are trying to do is Extend the class and then override the method.

正如Kirk woll所说,这并不像java。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签