Code example for Field

Methods: getModifiers, getType, set, toString

0
    } 
 
    @Override 
    public boolean _doset(PyObject self, PyObject value) {
        Object iself = null;
        if (!Modifier.isStatic(field.getModifiers())) {
            if (self == null) {
                throw Py.AttributeError("set instance variable as static: " + field.toString());
            } 
            iself = self.getJavaProxy();
            if (iself == null) {
                iself = self;
            } 
        } 
        Object fvalue = Py.tojava(value, field.getType());
 
        try { 
            field.set(iself, fvalue);
        } catch (IllegalAccessException exc) {
            throw Py.JavaError(exc);
        } 
        return true; 
    }