Get a read {@link Method} for a particular property.

@param bean
the bean instance
@param name
the name of the property
@return the getter method for the property
14456
public static Method getReadMethod(Object bean, String name) {
		return getReadMethods(bean).get(name);
	}
192727
public static PropertyDescriptor getPropertyDescriptor(Object bean, String propertyName)
	{
		BeanInfo beanInfo = getBeanInfo(bean);
		
		PropertyDescriptor propertyDescriptor = getFeatureDescriptor(propertyName, beanInfo.getPropertyDescriptors());

		checkArgument(propertyDescriptor != null, "No such property '%s' on bean: %s", propertyName, bean);
		
		return propertyDescriptor;
	}
462117
protected Object getBeanProperty(final Object object, String propertyName) {
        Object value;
        try {
            value = BeanUtils.getProperty(object, propertyName);
        } catch (InvocationTargetException e) {
            // ignore
            value = null;
        }
        return value;
    }
856974
public static Map<String, Object> getBeanProperties(Object bean) {
        Map<String, Object> props = new HashMap<>();

        if (bean == null) {
            return props;
        }

        Class<?> clazz = bean.getClass();
        try {
            //Public fields:
            Field[] fields = clazz.getFields();
            for (Field field : fields) {
                String name = field.getName();
                if (!name.equals("class")) {
                    props.put(field.getName(), field.get(bean));
                }
            }

            //Getters:
            BeanInfo info = Introspector.getBeanInfo(clazz);
            for (PropertyDescriptor desc : info.getPropertyDescriptors()) {
                Method readMethod = desc.getReadMethod();
                String name = desc.getName();
                if (readMethod != null && !name.equals("class")) {
                    props.put(desc.getName(), readMethod.invoke(bean));
                }
            }

            return props;
        } catch (IntrospectionException | IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) {
            throw new UniformException("Error while getting bean object properties of class" + clazz.getName(), ex);
        }
    }
1209886
public String getProperty(String name) {
        BugProperty prop = lookupProperty(name);
        return prop != null ? prop.getValue() : null;
    }
724643
@SuppressWarnings("unchecked")
    public static <T> T getProperty(String name) {
        return (T) getRequest().getProperty(name);
    }
418489
@Override
    public Object getProperty(String name)
    {
        Object ob = mConfig.getProperty(name);

        if (ob == null) {
            if (name.equals(XMLInputFactory.ALLOCATOR)) {
                // Event allocator not available via J2ME subset...
                return getEventAllocator();
            }
        }
        return ob;
    }
93041
public Object remove(String name) {
		Bean bean = beans.get(name);
		if (null != bean) {
			beans.remove(name);
			bean.destructionCallback.run();
			return bean.object;
		}
		return null;
	}
1247135
@Override
    public Object lookup(String name)
    {
        // Note: this context method is allowed from all bean methods,
        //       except the constructor... which has not way to access
        //       the context.  Therefore, no 'state' checking needs
        //       to be performed... just validate the parameter.
        if (name == null)
            throw new IllegalArgumentException("null 'name' parameter.");

        Object result = null;

        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(tc, "lookup: " + name);

        // Previously, this method used Naming for comp/env, which tolerated the
        // 'name' starting with 'java:comp/env/', but that is NOT part of the
        // name in our map.                                                d473811
        String lookupName = name;
        if (name.startsWith("java:comp/env/")) // F743-609 remove useless null check
        {
            lookupName = name.substring(14);
        }

        // -----------------------------------------------------------------------
        // Rather than perform a lookup using Naming, the InjectionBinding
        // that was created during populateJavaNameSpace will be located
        // and used to obtain/create the result object, just like it
        // would be done for injection.                                    d473811
        // -----------------------------------------------------------------------

        InjectionBinding<?> binding = home.beanMetaData.ivJavaColonCompEnvMap.get(lookupName);

        if (binding != null)
        {
            try
            {
                result = binding.getInjectionObject();
            } catch (InjectionException ex)
            {
                FFDCFilter.processException(ex, CLASS_NAME + ".lookup",
                                            "1342", this);
                IllegalArgumentException iae = new IllegalArgumentException
                                ("Failure occurred obtaining object for " + name +
                                 " reference defined for " + home.beanMetaData.j2eeName, ex);

                if (isTraceOn && tc.isEntryEnabled())
                    Tr.exit(tc, "lookup: " + iae);

                throw iae;
            }
        }
        else
        {
            result = container.getEJBRuntime().javaColonLookup(name, home);
        }

        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(tc, "lookup: " + result.getClass().getName());

        return result;
    }
662949
public static void clearBeanProperty(final Object bean, final String name) {
		Validate.notNull(bean, "Bean required");
		Validate.notEmpty(name, "Not empty property name required");

		final String methodName = new StringBuilder("set")
				.append(name.substring(0, 1).toUpperCase())
				.append(name.substring(1)).toString();
		for (Method method : bean.getClass().getMethods()) {
			if (method.getName().equals(methodName)) {
				try {
					method.invoke(bean, (Object) null);
					return;
				} catch (Exception exc) {
					throw new RuntimeException("Failed to clear property: "
							+ name);
				}
			}
		}
		throw new RuntimeException("Setter of property not found: " + name);
	}
561122
public final <T extends Property> T getProperty(final String name) {
        return (T) getProperties().getProperty(name);
    }
593062
public static Method getGetterMethod(Class<?> clazz, String propertyName) {
		String getterMethodName = GETTER_PREFIX + StringUtils.capitalize(propertyName);

		Method method = getMethod(clazz, getterMethodName);

		// retry on another name
		if (method == null) {
			getterMethodName = IS_PREFIX + StringUtils.capitalize(propertyName);
			method = getMethod(clazz, getterMethodName);
		}
		return method;
	}
611264
public <T> InternalEjbDescriptor<T> get(String beanName) {
        return cast(ejbByName.get(beanName));
    }
352459
public Object get(String name){
        return RequestContext.getHttpRequest().getSession(true).getAttribute(name);
    }
540096
public static String getter(String beanName, TypeName beanClass, ModelProperty property) {
		return beanName + (beanClass != null ? "." + getter(property) : "");
	}
112603
public static Object getBean(String name, Class requiredType) throws BeansException {
		return applicationContext.getBean(name, requiredType);
	}
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;
    }