Reflection

Spring Framework 의 Bean Factory μ—μ„œ μ–΄ν”Œλ¦¬μΌ€μ΄μ…˜ μ‹€ν–‰ν•œ ν›„ 객체가 호좜될 λ•Œ μΈμŠ€ν„΄μŠ€λ₯Ό μƒμ„±ν•˜λŠ” κ³Όμ •μ—μ„œ λ™μ μœΌλ‘œ μΈμŠ€ν„΄μŠ€λ₯Ό μƒμ„±ν•˜κ²Œ λ˜λŠ”λ° κ·Έ κ³Όμ •μ—μ„œ Reflection 이 μ‚¬μš©λœλ‹€.

Reflection 은 μžλ°” ν”„λ‘œκ·Έλž¨λ‚΄μ˜ λ‚΄λΆ€λ₯Ό κ²€μ‚¬ν•˜κ³  속성을 μˆ˜μ •ν•  수 μžˆλ„λ‘ ν•œλ‹€.

클래슀 λ©”μ„œλ“œ 좜λ ₯

νŠΉμ • ν΄λž˜μŠ€μ— μžˆλŠ” λ©”μ„œλ“œ 리슀트λ₯Ό 정보λ₯Ό 좜λ ₯ν•˜λŠ” μ½”λ“œλŠ” λ‹€μŒκ³Ό κ°™λ‹€.

 public void reflection() throws Exception {
    Class clazz = Class.forName("com.wemakeprice.epes.utils.PropertyUtilsTest");

    Method[] methods = clazz.getDeclaredMethods();

    for (int i = 0 ; i < methods.length; ++i) {
        System.out.println(methods[i]);
    }
}