import org.acornframework.core.ApplicationContext; public class Main { public static void main(String[] args) { ApplicationContext context = new ApplicationContext(); // ... // ... } } import org.acornframework.core.annotations.Inject; public class MyClass { @Inject private MyDependency dependency; } import org.acornframework.core.annotations.Aspect; import org.acornframework.core.annotations.Before; @Aspect public class LoggingAspect { @Before("execution(* com.example.MyClass.myMethod(..))") public void logBeforeMethodExecution() { // ... } } context.registerAspect(LoggingAspect.class); import org.acornframework.core.annotations.Entity; import org.acornframework.core.annotations.Repository; @Entity public class User { // ... } @Repository public class UserRepository { // ... }


上一篇:
下一篇:
切换中文