// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.beans.PropertyDescriptor;

public class Props {
    private int v;
    public int getV() {
        return v;
    }
    public void setV(int v) {
        this.v = v;
    }
    public static void main(String[] args) throws Exception {
        Props p = new Props();
        p.setV(123);
        Object o = p;
        PropertyDescriptor pd = new PropertyDescriptor("v", o.getClass());
        System.out.println(pd.getReadMethod().invoke(o));
        pd.getWriteMethod().invoke(o, 456);
        System.out.println(p.getV());
    }
}
