Code example for Field

Methods: isAccessible, setAccessible

0
 
 
    public FieldAccessor(Field field, boolean isReadOnly) {
        this.field = field;
        readOnly = isReadOnly;
        if (!field.isAccessible()) {
            field.setAccessible(true);
        } 
    } 
 
    public FieldAccessor(Field field) {
        this(field, false);
    } 
 
 
    @Override 
    public boolean isReadOnly() { 
        return readOnly;
    } 
 
    @Override