to get a visible Field of a object

@param obj Object to invoke
@param prop property to call
@return property value
@throws PageException
504152
public static Object getField(Object obj, String prop) throws PageException {
	try {
	    return getFieldsIgnoreCase(obj.getClass(), prop)[0].get(obj);
	}
	catch (Throwable e) {
	    ExceptionUtil.rethrowIfNecessary(e);
	    throw Caster.toPageException(e);
	}
    }
1067538
public static Object handleGetProperty(Object o, String prop) throws JspCoreException {
        if (o == null) {
            throw new JspCoreException("jsp.error.beans.nullbean");
        }
        Object value = null;
        try {
            Method method = getReadMethod(o.getClass(), prop);
            value = method.invoke(o, null);
        }
        catch (Exception ex) {
            throw new JspCoreException(ex);
        }
        return value;
    }
381416
private Object readField(final Field field, final Object obj) {
		try {
			return field.get(obj);
		} catch (IllegalAccessException e) {
			// Should not happen as we've called Field.setAccessible(true).
			LOG.error("Failed to read " + field.getName() + " of " + obj.getClass().getName(), e);
		}

		return null;
	}
765432
public static function getPropertyValue($obj,$propertyName,$fieldAccess=false)
    {
        $getter=self::getGetter($obj, $propertyName);
        if(!empty($getter)){
            return $obj->$getter();
        }else if($fieldAccess && property_exists($obj, $propertyName)){
            return $obj->$propertyName;
        }
    }
1017258
public static Object columnlist(PageContext pc, Object obj) throws PageException {
	if (obj instanceof Query) {
	    Key[] columnNames = ((Query) obj).getColumnNames();

	    boolean upperCase = pc.getCurrentTemplateDialect() == CFMLEngine.DIALECT_CFML;

	    StringBuilder sb = new StringBuilder();
	    for (int i = 0; i < columnNames.length; i++) {
		if (i > 0) sb.append(',');
		sb.append(upperCase ? columnNames[i].getUpperString() : columnNames[i].getString());
	    }
	    return sb.toString();

	}
	return pc.getCollection(obj, KeyConstants._COLUMNLIST);
    }
288462
function(obj, prop) {
        var node = null;
        if(obj[prop] != null) {
            node = this.createElementNS(this.namespaces.ol, "ol:" + prop);
            node.appendChild(this.createTextNode(obj[prop].toString()));
        }
        return node;
    }
18418
public static Object get(PageContext pc, Object coll, int[] types, Key[] keys, Object[][] args, Object defaultValue) throws PageException {
	if (coll == null) return defaultValue;
	int to = keys.length - 1;
	VariableUtilImpl vu = (VariableUtilImpl) pc.getVariableUtil();
	for (int i = 0; i <= to; i++) {
	    switch (types[i]) {
	    case TYPE_DATA:
		coll = vu.getCollection(pc, coll, keys[i], Null.NULL);
		break;
	    case TYPE_UDF_ARGS:
		coll = vu.callFunctionWithoutNamedValues(pc, coll, keys[i], args[i], false, Null.NULL);
		break;
	    case TYPE_UDF_NAMED_ARGS:
		coll = vu.callFunctionWithNamedValues(pc, coll, keys[i], args[i], false, Null.NULL);
		break;
	    case TYPE_BIF:
		coll = null;// TODO
		break;
	    }

	    if (coll == Null.NULL || (coll == null && i < to)) return defaultValue;
	}
	return coll;
    }
939273
private Object getObjectPropertyImpl(Context cx, Object object,
                                           Object id) {
        Scriptable scriptable = (Scriptable)object;
        Object result;
        if (id instanceof String) {
            String name = (String)id;
            if (name.equals("this")) {
                result = scriptable;
            } else if (name.equals("__proto__")) {
                result = scriptable.getPrototype();
            } else if (name.equals("__parent__")) {
                result = scriptable.getParentScope();
            } else {
                result = ScriptableObject.getProperty(scriptable, name);
                if (result == ScriptableObject.NOT_FOUND) {
                    result = Undefined.instance;
                }
            }
        } else {
            int index = ((Integer)id).intValue();
            result = ScriptableObject.getProperty(scriptable, index);
            if (result == ScriptableObject.NOT_FOUND) {
                result = Undefined.instance;
            }
        }
        return result;
    }
1081322
private Object getField(Object object, Field f) {
        f.setAccessible(true);
        try {
            return f.get(object);
        } catch (Exception e) {
            throw new RuntimeException(e.getMessage(), e);
        }
    }
739430
def _value(self, obj, cls=None):
        """"""
        if obj is not None:
            return getattr(obj, self.propname)
        else:
            return getattr(cls, self.propname)
987879
public static Field getField(String fieldName, Object object) {
    return getField(fieldName, object.getClass());
  }
40535
public T getValue(Object obj) throws IllegalAccessException, InvocationTargetException {
		if (field == null) {
			@SuppressWarnings("unchecked")
			T cast = (T) getMethod.invoke(obj);
			return cast;
		} else {
			@SuppressWarnings("unchecked")
			T cast = (T) field.get(obj);
			return cast;
		}
	}
717862
public static Object callGetter(Object target, PropertyDescriptor prop) {

        Object result = null;
        Method getter = prop.getReadMethod();

        if (getter == null) {
            throw new RuntimeException("No read method for bean property "
                    + target.getClass() + " " + prop.getName());
        }
        try {
            result = getter.invoke(target, new Object[0]);
        } catch (InvocationTargetException e) {
            throw new RuntimeException("Couldn't invoke method: " + getter,
                    e);
        } catch (IllegalArgumentException e) {
            throw new RuntimeException(
                    "Couldn't invoke method with 0 arguments: " + getter, e);
        } catch (IllegalAccessException e) {
            throw new RuntimeException("Couldn't invoke method: " + getter,
                    e);
        }

        return result;
    }
1130208
public static boolean setField(Object obj, String prop, Object value) throws PageException {
	Class clazz = value.getClass();
	try {
	    Field[] fields = getFieldsIgnoreCase(obj.getClass(), prop);
	    // exact comparsion
	    for (int i = 0; i < fields.length; i++) {
		if (toReferenceClass(fields[i].getType()) == clazz) {
		    fields[i].set(obj, value);
		    return true;
		}
	    }
	    // like comparsion
	    for (int i = 0; i < fields.length; i++) {
		if (like(fields[i].getType(), clazz)) {
		    fields[i].set(obj, value);
		    return true;
		}
	    }
	    // convert comparsion
	    for (int i = 0; i < fields.length; i++) {
		try {
		    fields[i].set(obj, convert(value, toReferenceClass(fields[i].getType()), null));
		    return true;
		}
		catch (PageException e) {}
	    }
	}
	catch (Exception e) {
	    throw Caster.toPageException(e);
	}
	return false;
    }
363902
private static Object readFieldValue(final Object obj, final Field field) {
    try {
      return field.get(obj);
    } catch (Exception ex) {
      throw new JBBPException("Can't get value from field [" + field + ']', ex);
    }
  }
1247996
public static Object recordcount(PageContext pc, Object obj) throws PageException {
	if (obj instanceof Query) return Caster.toDouble(((Query) obj).getRecordcount());
	return pc.getCollection(obj, KeyConstants._RECORDCOUNT);
    }
136850
function( obj ) { //set form html
    var accessor = this._getAccessor( obj );
    for( var i = 0; i < this.form.elements.length; i++) {
      this.deserializeField( this.form.elements[i], accessor );
    }
    return accessor.target;
  }