In the Java reflection world -
how do we find out if a Field object has the transient modifier?
http://docs.oracle.com/javase/tutorial/reflect/member/fieldModifiers.html
the documentation is not helping.
In the Java reflection world -
how do we find out if a Field object has the transient modifier?
http://docs.oracle.com/javase/tutorial/reflect/member/fieldModifiers.html
the documentation is not helping.
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
Field field = YourClass.class.getField("fieldName");
boolean isTransient = Modifier.isTransient(field.getModifiers());
For more details see Class Modifier
© 2022 - 2024 — McMap. All rights reserved.