ruby on rails - Is it possible to see via which child class was a parent's static method called in Java? -
A small background first. I am looking at the possibility of applying Ruby's Active Record in Java as clearly and briefly as possible, to do this, I will be allowed to call the following types of method:
Person person = person.find ("name", "mike");
Whatever is sorted out:
ActiveRecord.find (person class, "name", "mike");
This plan is to provide an active record to the person, which will have a stable search method with two parameters (column, value). This method will need to know that it was called through the person. There is no other domain class like searching and car. Find and Call Find (class, string, object) method to perform actual operation and call.
The problem is going on in I through the detection of the child of the active cell which was called the Stable Search Method (two Ultimate). The following is a simple test case:
Public class A {Public static zero testMethod () {// Need to know if A.testMethod (), B.testMethod (), Or c. Testmethod () called}} public square b expanded one {} public square c {} public square runner {public static zero main (string [] args) extends {A.testMethod (); B.testMethod (); C.testMethod (); }}
The solutions found so far are load-time or compile time using the Aspect-J. It must be included in the A at the test by putting a call interceptor and to know that the signature was used to call. I am woven for all load times, but set up to set it up (via VM Args) is a bit complicated
Is there any easy solution?
Is it possible that Java is possible or should something like Gravi / Ruby / Python be done?
Is there some ActiveRecord for stability loads? Can the person's alerts be better overall for examples?
You can not override static methods in Java, so any call through a subclass The static method will be bound to the base class at compile time. Thus Betest Mode () will be bound to a call e-testdition, before the applications can be played at any time.
Since you are looking for information on the runtime, it will not be available through normal Java operation.
Comments
Post a Comment