Annotation Interface LazyInit


@Target({FIELD,LOCAL_VARIABLE}) @Retention(CLASS) @Documented public @interface LazyInit

지연 로딩으로 초기화되는 변수임을 표시.

아래의 경우, init()을 통해 초기화되는 필드이므로 어노테이션이 사용됨.

     @LazyInit("init")
     public class Example {
         private String name;

         private void init() {
             if (this.name == null) {
                 this.name = "Smoodi";
             }
         }

         public void run() {
             init();

             ...
         }
     }
 
Since:
v1.0.0
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    초기화 메서드 혹은 트리거의 이름.
  • Element Details

    • value

      String value

      초기화 메서드 혹은 트리거의 이름.

      기본값은 빈 문자열이며, 이 경우 초기화 메서드가 없음을 의미.

      Returns:
      초기화 메서드 이름
      Default:
      ""