I was unexpectedly caught
@Singleton
class Test{
@I have a=new pen('yeah');
}
Suppose there is such a class
Test test=Test.getInstance();//error
This doesn't bring an instance of the Test class. Why
There is a method that can be accessed like Groovy in Java, so use that.
Test test=(Test)InvokerHelper.getProperty(Test.class,"instance");//OK
Recommended Posts