mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 23:39:39 +07:00
20 lines
472 B
Java
20 lines
472 B
Java
import java.lang.reflect.Field;
|
|
|
|
class Reflection {
|
|
void reflectionAccess(BeanWithWeirdFields someBean) throws NoSuchFieldException {
|
|
Field theField = someBean.getClass().getDeclaredField("UUID");
|
|
}
|
|
|
|
void testOther() {
|
|
BeanWithWeirdFields someBean = new BeanWithWeirdFields();
|
|
System.out.println(someBean.UUID);
|
|
}
|
|
|
|
static class BeanWithWeirdFields {
|
|
private String UUID;
|
|
|
|
public void setUUID(String UUID) {
|
|
this.UUID = UUID;
|
|
}
|
|
}
|
|
} |