获得Bean字段描述数组

@param clazz Bean类
@return 字段描述数组
@throws BeanException 获取属性异常
974519
public static PropertyDescriptor[] getPropertyDescriptors(Class<?> clazz) throws BeanException {
		BeanInfo beanInfo;
		try {
			beanInfo = Introspector.getBeanInfo(clazz);
		} catch (IntrospectionException e) {
			throw new BeanException(e);
		}
		return ArrayUtil.filter(beanInfo.getPropertyDescriptors(), new Filter<PropertyDescriptor>() {
			@Override
			public boolean accept(PropertyDescriptor t) {
				// 过滤掉getClass方法
				return false == "class".equals(t.getName());
			}
		});
	}
211180
public static <T> T getProperty(Object bean, String name, Class<T> clazz) throws Exception {
        Method method = ReflectUtils.getPropertyGetterMethod(bean.getClass(), name);
        if (method.isAccessible()) {
            return (T) method.invoke(bean);
        } else {
            try {
                method.setAccessible(true);
                return (T) method.invoke(bean);
            } finally {
                method.setAccessible(false);
            }
        }
    }
1045848
public static Class<?> getPropertyType(Class<?> clazz, String propertyName) {
        if (clazz == null || !StringUtils.hasText(propertyName)) {
            return null;
        }

        try {
            PropertyDescriptor desc=BeanUtils.getPropertyDescriptor(clazz, propertyName);
            if (desc != null) {
                return desc.getPropertyType();
            }
            return null;
        }
        catch (Exception e) {
            // if there are any errors in instantiating just return null for the moment
            return null;
        }
    }
1217785
public <T> String create(Class<T> clazz) {
        return create(clazz, null, null);
    }
512331
private <T> T get(Class<T> clazz) {
    try {
      return clazz.cast(get());
    } catch (ClassCastException e) {
      return null;
    }
  }
993885
@Override
    protected <T> T instantiateClass(Class<T> clazz) throws Throwable {
        // Get the current BeanManager for this module. If one doesn't exist it is because 
        // the module isn't CDI enabled and we fall back to the original behavior.

        ManagedObject<T> mo = null;
        if (releasableFactory != null) {
            mo = releasableFactory.createValidationReleasable(clazz);
        }

        if (mo != null) {
            if (releasables == null) {
                releasables = new LinkedList<ValidationReleasable<?>>();
            }

            // Save off the context under which the class was created as a CDI managed
            // bean so it can be cleaned up upon stopping the module.
            //releasables.add(mo);

            return mo.getObject();
        } else {
            return super.instantiateClass(clazz);
        }
    }
763893
public static PropertyDescriptor[] propertyDescriptors(Class<?> clazz) {
        BeanInfo beanInfo = null;
        try {
            beanInfo = Introspector.getBeanInfo(clazz);

        } catch (IntrospectionException ex) {
            throw new IllegalArgumentException(
                    "Bean introspection failed: " + ex.getMessage());
        }

        return beanInfo.getPropertyDescriptors();
    }
851999
@SuppressWarnings("rawtypes")
    private static Field getDeclaredField(Class clazz, String fieldName) throws NoSuchFieldException {
        Assert.notNull(clazz);
        Assert.hasText(fieldName);
        for (Class superClass = clazz; superClass != Object.class; superClass = superClass.getSuperclass()) {
            try {
                return superClass.getDeclaredField(fieldName);
            } catch (NoSuchFieldException e) {
                // Field不在当前类定义,继续向上转型
            }
        }
        throw new NoSuchFieldException("No such field: " + clazz.getName() + '.' + fieldName);
    }
69867
public static <A extends Annotation> A getAnnotation(final Class<?> clazz, Class<A> annoClazz) {
        if (clazz == null || annoClazz == null) {
            return null;
        }

        return clazz.getAnnotation(annoClazz);
    }
286562
@SuppressWarnings("unchecked")
	public <T> T getInstance(Class<T> beanClass) {
		String[] beanNames = applicationContext.getBeanNamesForType(beanClass);
		if (beanNames.length == 0) {
			return null;
		}
		return (T) applicationContext.getBean(beanNames[0]);
	}
977560
public static <T> List<T> handleWorkBookToBeans(Class<T> clazz, Workbook workbook) throws ReadExcelException {
        List<Map<String, Object>> listMap = ReadExcelUtils.handleWorkBookToMapList(workbook);
        List<T> beans = new ArrayList<T>();
        for (Map<String, Object> map : listMap) {
            T bean = CommonUtils.toBean(map, clazz);
            if (bean != null) {
                beans.add(bean);
            }
        }

        return beans;
    }
58161
public static <T> List<T> handleWorkBookToBeans(Class<T> clazz, File file) throws ReadExcelException {
        List<T> beans = null;
        try {
            Workbook workbook = WorkbookFactory.create(file);
            beans = ReadExcelUtils.handleWorkBookToBeans(clazz, workbook);
            if (workbook != null) {
                workbook.close();
            }
        } catch (Exception e) {
            throw new ReadExcelException(e.getMessage());
        }
        return beans;
    }
1270739
public static File getClassJar(Class clazz) {
		File file = null;

		try {
			file = new File(clazz.getProtectionDomain().getCodeSource().getLocation().toURI());
		} catch (URISyntaxException e) {}

		return file;
	}
671702
public ClassType<BeanType<T>> getOrCreateClazz()
   {
      Node node = childNode.getOrCreate("class");
      ClassType<BeanType<T>> clazz = new ClassTypeImpl<BeanType<T>>(this, "class", childNode, node);
      return clazz;
   }
184125
public static List<Field> findFields(final Class<?> clazz) {
        List<Field> foundFields = new ArrayList<>();
        Class<?> searchType = clazz;
        while (!Object.class.equals(searchType) && (searchType != null)) {
            Field[] fields = searchType.getDeclaredFields();
            for (Field field : fields) {
                field.setAccessible(true);
                foundFields.add(field);
            }
            searchType = searchType.getSuperclass();
        }
        return foundFields;
    }
1310964
public Annotation getAnnotation(final Class<? extends Annotation> clazz) {
        final List<Annotation> found = foundAnnotations.get(clazz);
        return found == null || found.isEmpty() ? null : found.get(found.size() - 1);
    }
1017896
public static <T> Clazz<T> Clazz( Class<T> clazz )
	{
		return impl.Clazz( clazz );
	}