Getter for a nested property in the given object.
@param obj The object
@param propertyName The name of the property to get
@return The property value
550279
public Object getNestedProperty(Object obj, String propertyName) {
        if (obj != null && propertyName != null) {
            return PresentationManager.getPm().get(obj, propertyName);
        }
        return null;
    }
478113
public Object get(Object propertyName) {
        if (propertyName instanceof CharSequence) {
            propertyName = propertyName.toString();
        }

        if (propertyName instanceof List) {
            Map submap = new HashMap();
            List propertyNames = (List)propertyName;
            for (Object currentName : propertyNames) {
                if (currentName != null) {
                    currentName = currentName.toString();
                    if (containsKey(currentName)) {
                        submap.put(currentName, get(currentName));
                    }
                }
            }
            return submap;
        }

        if (NameUtils.isConfigurational(propertyName.toString())) {
            return null;
        }

        Object val = null;
        MetaProperty mp = metaClass.getMetaProperty(propertyName.toString());
        if (mp != null) {
            val = mp.getProperty(instance);
        }
        return val;
    }
1259025
public String getAsString(Object obj, String propertyName) {
        Object o = get(obj, propertyName);
        if (o != null) {
            return o.toString();
        } else {
            return "";
        }
    }
393918
function getPropertyPathValue(obj, propertyPath) {
  var properties = Array.isArray(propertyPath) ? propertyPath : propertyPath.split(".");
  if (properties.length === 1) {
    return obj.getProperty(propertyPath);
  } else {
    var nextValue = obj;
    // hack use of some to perform mapFirst operation.
    properties.some(function (prop) {
      nextValue = nextValue.getProperty(prop);
      return nextValue == null;
    });
    return nextValue;
  }
}
443741
public static function getPropertyValue($object,$propertyName)
    {
        $getter = "get" . ucfirst($propertyName);
        if (method_exists($object, $getter)) {
            return $object->$getter();
        }
        return null;
    }
403127
public Property getProperty(String... name) {
        if (name == null || name.length == 0) return null;

        for (Property p : properties) {
            if (Objects.equals(name[0], p.name)) {
                if (name.length == 1)
                    return p;
                else
                    return p.getProperty(Arrays.copyOfRange(name, 1, name.length));
            }
        }
        return null;
    }
14528
private String getProperty(String propertyName) {
            return propertyName == null ? null : (String) getPropertyValue(propertyName);
        }
40992
public static <T> T getPropertyValue(final Object instance, final String fieldName) {
		try {
			return (T) PropertyUtils.getProperty(instance, fieldName);
		} catch (final Exception e) {
			throw new RuntimeException(e);
		}
	}
566484
@Override
    public <T> T getJsonProperty(String propertyName) {
        return (T) getProperty(propertyName, String.class);
    }
204628
public static Object getFieldValue(final Object obj, final String fieldName) {
		Field field = getAccessibleField(obj, fieldName);

		if (field == null) {
			throw new IllegalArgumentException("Could not find field [" + fieldName + "] on target [" + obj + "]");
		}

		Object result = null;
		try {
			result = field.get(obj);
		} catch (IllegalAccessException e) {
			logger.error("不可能抛出的异常{}", e.getMessage());
		}
		return result;
	}
890405
public static String getPropertyValue( AbstractBlockHolder holder, String propertyName ) {
		BlockProperty p = holder.findPropertyBlockByName( propertyName );
		return p == null ? null : p.getValue();
	}
865425
private static Object getValue(Object obj, String propertyPattern, ObjectWrapper options) {
        if (propertyPattern == null) {
            throw new IllegalArgumentException("Cannot get the value from a property with a 'null' propertyPattern.");
        }

        if (obj == null) {
            // NullPointerException as it is throwed only when traversing a null object (ex: "foo.null.bar")
            throw new NullPointerException("Cannot get the value of '" + propertyPattern + "' from a 'null' object.");
        }

        // '.' position if positive, '[' inverse position if negative
        int position = indexOfDotOrSquare(propertyPattern);

        // (propertyPattern.contains("."))
        if (position > 0) {
            String leftPattern = propertyPattern.substring(0, position);
            String rightPattern = propertyPattern.substring(position + 1, propertyPattern.length());
            Object leftValue = getValue(obj, leftPattern, options);

            return getValue(leftValue, rightPattern, options);
            // if (propertyPattern.contains("["))
        } else if (position < 0) {
            int squarePosition = -position;

            String leftPattern = propertyPattern.substring(0, squarePosition);
            String indexOrKey = propertyPattern.substring(squarePosition + 1, propertyPattern.length() - 1);// removes ']'
            Property leftProperty = getPropertyOrThrow(Bean.forClass(obj.getClass()), leftPattern);

            if (Map.class.isAssignableFrom(leftProperty.getType())) {
                return getMappedValue(obj, leftProperty, indexOrKey);
            } else {
                try {
                    return getIndexedValue(obj, leftProperty, Integer.parseInt(indexOrKey), options);
                } catch (NumberFormatException e) {
                    throw new IllegalArgumentException("The pattern '" + indexOrKey + "' for the indexed "
                                                               + leftProperty + " is invalid. Cannot parse the string to a valid integer index.");
                }
            }
        }

        return getSimpleValue(obj, getPropertyOrThrow(Bean.forClass(obj.getClass()), propertyPattern));
    }
475869
protected final Object getProperty(final Object obj, final String property) {
        if ((obj == null) || (property == null) || (property.trim().length() == 0)) {
            return null;
        }
        final String[] getterNames = createGetterNames(property);
        for (int i = 0; i < getterNames.length; i++) {
            final String getter = getterNames[i];
            try {
                final Class cl = obj.getClass();
                final Method m = cl.getMethod(getter, new Class[] {});
                return m.invoke(obj, new Object[] {});
            } catch (final IllegalAccessException e) {
                throw new RuntimeException("Accessing " + getter + " method of property '" + property + "' failed (private? protected?)! ["
                        + obj.getClass() + "]", e);
            } catch (final InvocationTargetException e) {
                throw new RuntimeException(
                        "Exception within " + getter + " method of property '" + property + "'! [" + obj.getClass() + "]", e.getCause());
            } catch (final NoSuchMethodException e) {
                if (i == getter.length() - 1) {
                    throw new RuntimeException("No " + getter + " method found for property! '" + property + "'! [" + obj.getClass() + "]",
                            e);
                }
            }
        }
        throw new IllegalStateException("No getters defined in 'createGetterNames()'!");
    }
1257673
public GrProperty getProperty(String propertyName) {
		for (GrProperty prop : getProperties()) {
			if (prop.getName().equals(propertyName))
				return prop;
		}
		return null;
	}
506256
public Object getProperty(String propName)
    {
        /* Related to [WSTX-243]; would be nice to not to have to throw an
         * exception; but Stax spec suggests that we do need to indicate
         * unrecognized property by exception.
         */
        int id = findPropertyId(propName);
        if (id >= 0) {
            return getProperty(id);
        }
        id = findStdPropertyId(propName);
        if (id < 0) {
            reportUnknownProperty(propName);
            return null;
        }
        return getStdProperty(id);
    }
363332
public static Key<String> getPropertyKey(String propertyName) {
        return Key.get(String.class, Names.named(propertyName));
    }
803885
public String getStringProperty(String propertyName) {
        Object value = this.properties.get(propertyName);
        if (null != value && value instanceof String) {
            return (String) value;
        }
        return null;
    }