레이블이 Java인 게시물을 표시합니다. 모든 게시물 표시
레이블이 Java인 게시물을 표시합니다. 모든 게시물 표시

2017년 5월 10일 수요일

Annotation

Custom Annotation

선언
@Retention(용도)
@Target(범위)
public @interface XXX {
    ...
}

용도
RetentionPolicy.java (java.lang.annotation)
/**
 * @since 1.5
 */
public enum RetentionPolicy {
    /**
     * Annotations are to be discarded by the compiler.
     * 컴파일러가 사용하고 클래스 파일 안에 포함되지 않음 (단순 주석용, 컴파일러용)
     */
    SOURCE,

    /**
     * Annotations are to be recorded in the class file by the compiler
     * but need not be retained by the VM at run time.  This is the default
     * behavior.
     * 컴파일시 클래스 파일 안에 포함되나 VM에서 무시함
     */
    CLASS,

    /**
     * Annotations are to be recorded in the class file by the compiler and
     * retained by the VM at run time, so they may be read reflectively.
     * 컴파일시 포함되고 VM에서 인식함
     * @see java.lang.reflect.AnnotatedElement
     */
    RUNTIME
}

범위
ElementType.java (java.lang.annotation)
/**
 * @since 1.5
 */
public enum ElementType {
    /** Class, interface (including annotation type), or enum declaration */
    TYPE,

    /** Field declaration (includes enum constants) */
    FIELD,

    /** Method declaration */
    METHOD,

    /** Formal parameter declaration */
    PARAMETER,

    /** Constructor declaration */
    CONSTRUCTOR,

    /** Local variable declaration */
    LOCAL_VARIABLE,

    /** Annotation type declaration */
    ANNOTATION_TYPE,

    /** Package declaration */
    PACKAGE,

    /**
     * Type parameter declaration
     *
     * @since 1.8
     * @hide 1.8
     */
    TYPE_PARAMETER,

    /**
     * Use of a type
     *
     * @since 1.8
     * @hide 1.8
     */
    TYPE_USE
}

2015년 12월 14일 월요일

민생회복 소비쿠폰이란?

  ⚡ 민생회복 소비쿠폰, 2025년 최신 정보! 신청부터 사용까지 완벽 가이드 솔직히 저도 처음에 이거 받으면서 엄청 헤맸거든요. 온라인 신청은 어디서 하는지, 누가 얼마나 받는지부터 사용처까지 헷갈리는 게 한두 개가 아니었어요. 여러분도 혹시 저처...