Validatinator.utils.getFieldValue(String form, String field);

Gets a field's value based off of the field's name attribute, but first we test
to make sure that field's form name attribute is that of our currently validating field.

@Added: 1/17/2014
506642
function(form, field) {
        var fieldsArray,
            fieldValue,
            fieldElement,
            i = 0;

        // Instead of trusting that the first element returned is the actual field, we will go ahead
        // and test if the field is truly within the form that we are validating against.
        fieldsArray = document.getElementsByName(field);

        for (; i<fieldsArray.length; i++) {
            fieldElement = fieldsArray[i];

            // We are running a simple test to see if the current field in the returned array is part of
            // our validating field or not.  If it is then grab it's value and break out of this test loop.
            if (fieldElement.form && fieldElement.form.name === form) {
              if (['radio', 'checkbox'].indexOf(fieldElement.type) !== -1 && !fieldValue) {
                    if(fieldElement.checked) {
                        fieldValue = fieldElement.value;
                        break;
                    } else {
                        fieldValue = "";
                        continue;
                    }
                } else {
                    fieldValue = fieldElement.value;
                }
                break;
            }
        }

        // If no field value was stored then we will assume that the field couldn't be found.  An empty string is
        // not considered a "non-stored field value."
        if (! fieldValue && fieldValue !== "")
            throw new Error("Couldn't find the field element " + field + " for the form " + form + ".");

        return fieldValue;
    }
331333
public static Object getDeclaredFieldValue(Object object, String declaredFieldName)
			throws Exception
	{
		Field field = object.getClass().getDeclaredField(declaredFieldName);

		field.setAccessible(true);

		return field.get(object);
	}
475226
def validateField(cls, fieldName, value) :
        
        try :
            valValue = Collection.validateField(fieldName, value)
        except SchemaViolation as e:
            if fieldName == "_from" or fieldName == "_to" :
                return True
            else :
                raise e
        return valValue
906502
function getFormSubmitValues(form) {
      var fields = form.getValues(false, false, false, false);
      return fields; // O
    }
399320
public static final Object getValue(Object obj, String fieldName) {
        try {
            return getField(obj.getClass(), fieldName).get(obj);
        } catch (IllegalArgumentException e) {
            throw new RuntimeException(e);
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        }
    }
679656
Field getField(String name)
    {       
        FieldInfo info=getFieldInfo(name);
        return getField(info,true);
    }
1319063
private String getField(String fieldValue)
    {
        return fieldValue.substring(fieldValue.indexOf(ESConstants.DOT) + 1, fieldValue.length());
    }
387751
private Object doGetFieldValue(String fullField, String field, Object object, boolean useCache,
            Map<String, ReflectInfo> cachedFields) {
        // check cache
        Field f;
        if (useCache) {
            ReflectInfo info = cachedFields.get(fullField);
            if (info != null) {
                return getField(info.target, info.field);
            }
        }

        int index = field.indexOf('.');
        if (index != -1) {
            String parent = field.substring(0, index);
            String sub = field.substring(index + 1);

            try {
                f = FieldUtils.findField(object.getClass(), parent);
                if (f == null) {
                    throw new RuntimeException(
                            "No field '" + parent + "' found at class " + object.getClass().getName());
                }
                f.setAccessible(true);
                Object o = f.get(object);
                if (o == null) {
                    return null;
                }
                return get(fullField, sub, o);
            } catch (Exception e) {
                throw new RuntimeException(e.getMessage(), e);
            }
        }

        f = FieldUtils.findField(object.getClass(), field);
        if (f == null) {
            throw new RuntimeException("No field '" + field + "' found at class " + object.getClass().getName());
        }
        if (useCache && !cachedFields.containsKey(fullField)) {
            cachedFields.put(fullField, new ReflectInfo(f, object));
        }
        return getField(object, f);
    }
1178177
private Object getFieldValue(final Field field) {
        Object field_value = AccessController.doPrivileged(new PrivilegedAction<Object>() {
            @Override
            public Object run() {
                try {
                    Object value = field.get(_member);

                    // Don't dump sensitive data
                    boolean sensitive = _member.getClass().isAnnotationPresent(Sensitive.class) || field.isAnnotationPresent(Sensitive.class);
                    if (value != null && sensitive) {
                        value = DataFormatHelper.sensitiveToString(value);
                    }

                    return value;
                } catch (IllegalAccessException e) {
                    // No FFDC code needed - we're in the middle of FFDC'ing!
                    // Should not happen - if it does return a string :-)
                    return "/* Could not access " + field.getName() + " */";
                }
            }
        });
        return field_value;
    }
33737
@Api
	public void getValue(String name, BooleanAttribute attribute) {
		attribute.setValue(toBoolean(formWidget.getValue(name)));
	}
1087720
private Object getFieldValue(Object bean)
            throws IllegalAccessException, InvocationTargetException, NoSuchMethodException {
        return PropertyUtils.getProperty(bean, field.getName());
    }
122408
@Override
    @SuppressWarnings("StringEquality")
    public Object getField(String name) throws UnresolvedException{
        if(name=="status")
            return status;
        else
            return super.getField(name);
    }
480254
public String getSFieldValue(boolean bDisplayFormat, boolean bRawData)
    {
        Convert converter = this.getConverter();
        if (converter == null)
            return Constant.BLANK;
        if (bRawData)
        {
            converter = converter.getField();
            if (converter == null)
                return Constant.BLANK;
        }
        return converter.getString();
    }
1335044
@Override
    @SuppressWarnings("StringEquality")
    public Object getField(String name) throws UnresolvedException{
        if(name=="method")
            return method==null ? null : method.toString();
        else if(name=="uri")
            return uri;
        else if(name=="line")
            return method+" "+uri+' '+version;
        else if(name=="query_string"){
            if(uri==null)
                return null;
            int question = uri.indexOf('?');
            return question==-1 ? "" : uri.substring(question+1);
        }else if(name=="cookies")
            return getCookies();
        else
            return super.getField(name);
    }
24
@Api
	public void getValue(String name, ShortAttribute attribute) {
		attribute.setValue(toShort(formWidget.getValue(name)));
	}
540477
@Api
	public void getValue(String name, DateAttribute attribute) {
		attribute.setValue((Date) formWidget.getValue(name));
	}
15563
public static Object getFieldValue(Object object, String fieldName) {
        try {
            return getDeclaredFieldInHierarchy(object.getClass(), fieldName).get(object);
        } catch (IllegalArgumentException e) {
            throw new RuntimeException(e);
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        }
    }