/** * Get the value of a field or property (getter method) from an object<br/> * Getting fields supports simple, nested, indexed, and mapped values:<br/> * <b>Simple:</b> Get/set a field in a bean (or map), Example: "title", "id"<br/> * <b>Nested:</b> Get/set a field in a bean which is contained in another bean, Example: "someBean.title", "someBean.id"<br/> * <b>Indexed:</b> Get/set a list/array item by index in a bean, Example: "myList[1]", "anArray[2]"<br/> * <b>Mapped:</b> Get/set a map entry by key in a bean, Example: "myMap(key)", "someMap(thing)"<br/> * * @param object any object * @param fieldName the name of the field (property) to get the value of or the getter method without the "get" and lowercase first char * @throws FieldnameNotFoundException if this fieldName does not exist on the object * @throws IllegalArgumentException if a failure occurs while getting the field value */ public Object getFieldValue(Object object, String fieldName) { return getFieldUtils().getFieldValue(object, fieldName); }
Object value = getFieldUtils().getFieldValue(orig, name); if (ignoreNulls && value == null) {
/** * Get the value of a field or property (getter method) from an object<br/> * Getting fields supports simple, nested, indexed, and mapped values:<br/> * <b>Simple:</b> Get/set a field in a bean (or map), Example: "title", "id"<br/> * <b>Nested:</b> Get/set a field in a bean which is contained in another bean, Example: "someBean.title", "someBean.id"<br/> * <b>Indexed:</b> Get/set a list/array item by index in a bean, Example: "myList[1]", "anArray[2]"<br/> * <b>Mapped:</b> Get/set a map entry by key in a bean, Example: "myMap(key)", "someMap(thing)"<br/> * * @param object any object * @param fieldName the name of the field (property) to get the value of or the getter method without the "get" and lowercase first char * @throws FieldnameNotFoundException if this fieldName does not exist on the object * @throws IllegalArgumentException if a failure occurs while getting the field value */ public Object getFieldValue(Object object, String fieldName) { return getFieldUtils().getFieldValue(object, fieldName); }
Object value = getFieldUtils().getFieldValue(orig, name); if (ignoreNulls && value == null) {
/** * Get the value of a field on an object as a specific type, * name can be nested, indexed, or mapped * @param obj any object * @param name the name of a field on this object * @param asType the type to return the value as (converts as needed) * @return the value in the field as the type requested * @throws FieldnameNotFoundException if this field name is invalid for this object * @throws FieldGetValueException if the field is not readable or not visible * @throws UnsupportedOperationException if the value cannot be converted to the type requested * @throws IllegalArgumentException if there is a failure getting the value */ public <T> T getFieldValue(Object obj, String name, Class<T> asType) { Object o = getFieldValue(obj, name); T value = getConversionUtils().convert(o, asType); return value; }
/** * Get the value of a field on an object as a specific type, * name can be nested, indexed, or mapped * @param obj any object * @param name the name of a field on this object * @param asType the type to return the value as (converts as needed) * @return the value in the field as the type requested * @throws FieldnameNotFoundException if this field name is invalid for this object * @throws FieldGetValueException if the field is not readable or not visible * @throws UnsupportedOperationException if the value cannot be converted to the type requested * @throws IllegalArgumentException if there is a failure getting the value */ public <T> T getFieldValue(Object obj, String name, Class<T> asType) { Object o = getFieldValue(obj, name); T value = getConversionUtils().convert(o, asType); return value; }
Object o = getFieldValue(obj, name); values.put(name, o); } catch (RuntimeException e) {
Object o = getFieldValue(obj, name); values.put(name, o); } catch (RuntimeException e) {
} else { Object dest = getFieldUtils().getFieldValue(object, fieldName); if (dest == null) {
} else { Object dest = getFieldUtils().getFieldValue(object, fieldName); if (dest == null) {
Object value = getFieldUtils().getFieldValue(bean, name); if (value == null && ignoreNulls) { continue;
Object value = getFieldUtils().getFieldValue(bean, name); if (value == null && ignoreNulls) { continue;