Returns the value of the <em>bean</em> using the default {@link #getMethod}.
If the value is unknown returns null or an empty set depending on the cardinality.
@param bean the object whose property is requested
@return an object as the value
182145
@Override public Set<R> getValueFromBean(D bean) throws IllegalBioPAXArgumentException
	{
		Object value = null;
		try
		{
			if (this.getDomain().isInstance(bean)) value = this.getMethod.invoke(bean);
		}
		catch (IllegalAccessException e)
		{
			throw new IllegalBioPAXArgumentException(
					"Could not invoke get method " + getMethod.getName() + " for " + bean, e);
		}
		catch (IllegalArgumentException e)
		{
			throw new IllegalBioPAXArgumentException(
					"Could not invoke get method " + getMethod.getName() + " for " + bean, e);
		}

		catch (InvocationTargetException e)
		{
			throw new IllegalBioPAXArgumentException(
					"Could not invoke get method " + getMethod.getName() + " for " + bean, e);
		}

		if (value == null) return Collections.emptySet();
		else if (this.isMultipleCardinality())
		{
			return (Collections.unmodifiableSet(((Set<R>) value)));
		} else
		{
			return Collections.singleton(((R) value));
		}
	}
144942
protected static ThreadMXBean getBean() {
        if (PreciseTime.bean == null)
            PreciseTime.bean = ManagementFactory.getThreadMXBean();
        return PreciseTime.bean;
    }
418173
protected Object getBeanPropertyValue(final String property, final Object bean) {
		if (bean == null) {
			return null;
		}

		if (".".equals(property)) {
			return bean;
		}

		try {
			Object data = PropertyUtils.getProperty(bean, property);
			return data;
		} catch (Exception e) {
			LOG.error("Failed to get bean property " + property + " on " + bean, e);
			return null;
		}
	}
199680
public static String[][] getProperties(final Bean bean) {
        final List<String> propertyNames = bean.getPropertyNames();
        final int psize = propertyNames.size();
        final String[][] properties = new String[psize][];
        for (int i = 0; i < psize; i++) {
            final String propertyName = propertyNames.get(i);
            final List<String> values = bean.getValues(propertyName);
            final int vsize = values.size();
            properties[i] = new String[vsize + 1];
            properties[i][0] = propertyName;
            for (int j = 0; j < vsize; j++) {
                properties[i][j + 1] = values.get(j);
            }
        }
        return properties;
    }
612184
public Map<String, Object> write(Bean bean) {
        JodaBeanUtils.notNull(bean, "bean");
        return writeBean(bean, bean.getClass());
    }
1209115
protected final Object beanLookup(Object value, Object propertyName) {
        LOGGER.trace("get JavaBean property : " + propertyName);
        return ParseUtils.getProperty(value, propertyName.toString(), PROPERTY_CACHE);
    }
146799
@Override
    public P get(Bean bean) {
        return clazz.cast(metaBean().metaProperty(name()).get(bean));
    }
840983
public static <T> T getInstance(Class<T> beanClass, String beanName) {
		return (T) getInstanceProvider().getInstance(beanClass, beanName);
	}
431294
public static Map<String, EntryValue> convertBeanToEntryMap(Object bean) {
        Map<String, Object> buildAttributeValueMap = BeanUtilsExtended.buildObjectAttributeMap(bean);
        return Maps.transformEntries(buildAttributeValueMap, new ObjectToEntryValueTransformer());
    }
1215900
@Override
    public P get(Bean bean) {
        try {
            return (P) getter.invokeExact(bean);
        } catch (RuntimeException | Error ex) {
            throw ex;
        } catch (Throwable ex) {
            throw new RuntimeException(ex);
        }
    }
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;
    }
1155000
@SuppressWarnings("unchecked")
	public T getInstance() {
		if(beanClassName == null) {
			return null;
		} else try {
			T beanInstance;
			Class<T> beanClass = null;
			try {
				try {
					ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
					beanClass = (Class<T>)Class.forName(beanClassName, true, classLoader);
				} catch(ClassNotFoundException cnfe) {
					throw new RuntimeException("Unknown class " + beanClassName, cnfe);
				}
				// Instancjonowanie i inicjalizcja w oparciu o konstruktor inicjujący:
				Constructor<T> constructor = (Constructor<T>)beanClass.getConstructor(Collection.class);
				beanInstance = constructor.newInstance(properties);
			} catch(NoSuchMethodException nsme) {
				// Instancjonowanie i inicjalizacja w oparciu o konstruktor bezargumentowy
				// i publiczne setter'y Java Beans:
				beanInstance = beanClass.newInstance();

				if(properties != null && !properties.isEmpty()) {
					BeanInfo validatorInfo = Introspector.getBeanInfo(beanClass);
					PropertyDescriptor[] propertyDescriptors = validatorInfo.getPropertyDescriptors();
					for(BeanProperty beanProperty : properties) {
						String propertyName = beanProperty.getPropertyName();
						Method writeMethod = null;
						for(PropertyDescriptor propertyDescriptor : propertyDescriptors) {
							if(propertyDescriptor.getName().equals(propertyName)) {
								writeMethod = propertyDescriptor.getWriteMethod();
								break;
							}
						}
						if(writeMethod == null) {
							throw new RuntimeException("No public setter found for property '" + propertyName + "' "
									+ "in validator class " + beanClass.getCanonicalName());
						}
						Class<?> parameterType = writeMethod.getParameterTypes()[0];
						if(BeanProperty.class.equals(parameterType)) {
							writeMethod.invoke(beanInstance, beanProperty);
						} else if(String.class.equals(parameterType)) {
							if(beanProperty.hasAttributes()) {
								throw new RuntimeException("BeanProperty '" + propertyName + "' setter should has "
										+ Parameter.class.getSimpleName() + " type parameter");
							}
							writeMethod.invoke(beanInstance, beanProperty.getPropertyValue());
						}
					}
				}
			}
			return beanInstance;
		} catch(Exception e) {
			throw new RuntimeException(e);
		}
	}
1209653
private static Method findGetMethod(Class<? extends Bean> beanType, String getterName) {
        try {
            return beanType.getDeclaredMethod(getterName);
        } catch (NoSuchMethodException ex) {
            try {
                return beanType.getMethod(getterName);
            } catch (NoSuchMethodException ex2) {
                return null;
            }
        }
    }
560520
private <T> T getReference(final Bean<T> bean) {
        T ret = (T) beanReferences.get(bean);

        if (null != ret) {
            return ret;
        }

        ret = bean.create();

        if (null != ret) {
            beanReferences.put(bean, ret);

            return ret;
        }

        throw new RuntimeException("Can't create reference for bean [" + bean + "]");
    }
782310
public <T> T getBean(K key, Class<T> beanType) {
		final JSONObject obj = getJSONObject(key);
		return (null == obj) ? null : obj.toBean(beanType);
	}
1124759
protected Object getMacroBeanValue(Object bean, String property) {

        Object result = null;
        if ((bean != null) && CmsStringUtil.isNotEmptyOrWhitespaceOnly(property)) {
            try {
                PropertyUtilsBean propBean = BeanUtilsBean.getInstance().getPropertyUtils();
                result = propBean.getProperty(bean, property);
            } catch (Exception e) {
                LOG.error("Unable to access property '" + property + "' of '" + bean + "'.", e);
            }
        } else {
            LOG.info("Invalid parameters: property='" + property + "' bean='" + bean + "'.");
        }
        return result;
    }
939474
public Object defineBean(String name, Object bean) {
        Object ret = getELContext().getBeans().get(name);
        getELContext().getBeans().put(name, bean);
        return ret;
    }