<p>根据JAVA对象注解获取Excel表头信息</p>

@param clz 类型
@return 表头信息
337525
public static List<ExcelHeader> getHeaderList(Class<?> clz) throws Excel4JException {

        List<ExcelHeader> headers = new ArrayList<>();
        List<Field> fields = new ArrayList<>();
        for (Class<?> clazz = clz; clazz != Object.class; clazz = clazz.getSuperclass()) {
            fields.addAll(Arrays.asList(clazz.getDeclaredFields()));
        }
        for (Field field : fields) {
            // 是否使用ExcelField注解
            if (field.isAnnotationPresent(ExcelField.class)) {
                ExcelField er = field.getAnnotation(ExcelField.class);
                try {
                    headers.add(new ExcelHeader(
                            er.title(),
                            er.order(),
                            er.writeConverter().newInstance(),
                            er.readConverter().newInstance(),
                            field.getName(),
                            field.getType()
                    ));
                } catch (InstantiationException | IllegalAccessException e) {
                    throw new Excel4JException(e);
                }
            }
        }
        Collections.sort(headers);
        return headers;
    }
816102
public ClassDocImpl getClassDoc(ClassSymbol clazz) {
        ClassDocImpl result = classMap.get(clazz);
        if (result != null) return result;
        if (isAnnotationType(clazz)) {
            result = new AnnotationTypeDocImpl(this, clazz);
        } else {
            result = new ClassDocImpl(this, clazz);
        }
        classMap.put(clazz, result);
        return result;
    }
267979
public static List<ReflectedInfo> getExposedFieldInfo(final Class<?> clazz) {
        List<ReflectedInfo> results = null;
        try {
            results = fieldInfoCache.get(clazz, new Callable<List<ReflectedInfo>>() {
                /**
                 * This method is called if the value is not found in the cache. This
                 * is where the real reflection work is done.
                 */
                public List<ReflectedInfo> call() throws Exception {
                    List<ReflectedInfo> exposed = new ArrayList<ReflectedInfo>();
                    for (Method m : clazz.getMethods()) {
                        if(isIgnored(m)) {
                            continue;
                        }
                        boolean methodIsSirenProperty = m.getAnnotation(Siren4JProperty.class) != null;
                        String methodAnnotationName = extractEffectiveName(m, null);
                        if (ReflectionUtils.isGetter(m)) {
                            Field f = getGetterField(m);
                            if(f != null && isIgnored(f)) {
                                continue;
                            }
                            if (f != null) {
                                String fieldAnnotationName = extractEffectiveName(f, null);
                                String effectiveName = (String)findFirstNonNull(
                                    Arrays.asList(fieldAnnotationName, methodAnnotationName, f.getName()).iterator()
                                );
                                exposed.add(
                                    new ReflectedInfo(f, m, ReflectionUtils.getSetter(clazz, f), effectiveName)
                                );
                            } else if(methodIsSirenProperty) {// looks like we have getter not backed by field
                                exposed.add(
                                    ReflectedInfoBuilder.aReflectedInfo().
                                            withGetter(m).
                                            withEffectiveName(extractEffectiveName(m, stripGetterPrefix(m.getName()))).
                                                build()
                                );
                            }
                        } else if(methodIsSirenProperty) {
                            exposed.add(
                                ReflectedInfoBuilder.aReflectedInfo().
                                        withGetter(m).
                                        withEffectiveName(extractEffectiveName(m, m.getName())).
                                            build()
                            );
                        }
                    }
                    return exposed;
                }
            });
        } catch (ExecutionException e) {
            throw new Siren4JRuntimeException(e);
        }
        return results;

    }
488330
public <T> T getValue(Class<T> clazz) {
        if (this.cellValue == null) {
            return null;
        } else {
            if(Number.class.isAssignableFrom(cellValue.getClass())){
                return null;
            }else{
                return (T) this.cellValue;
            }

        }
    }
1311951
public static String mapObjectToXML(String clazz) {
		for (int i = 0; i < keyWordMapping.length; i++) {
			if (keyWordMapping[i][1].equalsIgnoreCase(clazz)) {
				return keyWordMapping[i][0];
			}
		}
		return clazz;
	}
905465
public static Method getMethod(Class clazz, String methodName, Class<?>... parameterTypes) {
        if (clazz == null) {
            return null;
        }
        try {
            return clazz.getDeclaredMethod(methodName, parameterTypes);
        } catch (SecurityException e) {
            e.printStackTrace();
        } catch (NoSuchMethodException e) {
            e.printStackTrace();
        }
        return null;
    }
268828
public <T> Clazz<T> FindClazz( Class<T> clazz )
	{
		if( clazzz == null )
			return null;

		for( Clazz<?> c : clazzz.values() )
			if( c.getReflectedClass() == clazz )
			{
				@SuppressWarnings( "unchecked" )
				Clazz<T> result = (Clazz<T>) c;
				return result;
			}

		return null;
	}
811893
public String getLocation(Class<?> clazz) {

        String filename = clazz.getName().replace('.', '/');
        int pos = filename.lastIndexOf('/') + 1;
        return (pos > 0 ? filename.substring(0, pos) : "");
    }
132837
public static Method[] getAllInstanceMethods(final Class<?> clazz) {
        if (clazz == null) {
            return null;
        }

        List<Method> methods = new ArrayList<Method>();
        for (Method method : clazz.getMethods()) {
            if (!Modifier.isStatic(method.getModifiers())
                    && Modifier.isPublic(method.getModifiers())) {
                methods.add(method);
            }
        }

        return methods.toArray(new Method[methods.size()]);
    }
16583
public static List<Field> getAllFields(Class<?> clazz) {
        final List<Field> ret = new ArrayList<>();
        do {
            ret.addAll(Arrays.asList(clazz.getDeclaredFields()));
            clazz = clazz.getSuperclass();
        } while (clazz != null);
        return ret;
    }
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());
			}
		});
	}
340975
private <P> SheetBindingErrors<P> loadSheet(final Sheet sheet, final Class<P> clazz, final AnnotationReader annoReader)
            throws XlsMapperException {

        // 値の読み込み対象のJavaBeanオブジェクトの作成
        final P beanObj = configuration.createBean(clazz);

        final SheetBindingErrors<P> errors =  configuration.getBindingErrorsFactory().create(beanObj);
        errors.setSheetName(sheet.getSheetName());
        errors.setSheetIndex(sheet.getWorkbook().getSheetIndex(sheet));

        final LoadingWorkObject work = new LoadingWorkObject();
        work.setAnnoReader(annoReader);
        work.setErrors(errors);

        // セルのキャッシュ情報の初期化
        configuration.getCellFormatter().init(configuration.isCacheCellValueOnLoad());

        final FieldAccessorFactory adpterFactory = new FieldAccessorFactory(annoReader);

        // リスナークラスの@PreLoad用メソッドの実行
        final XlsListener listenerAnno = annoReader.getAnnotation(beanObj.getClass(), XlsListener.class);
        if(listenerAnno != null) {
            for(Class<?> listenerClass : listenerAnno.value()) {
                final Object listenerObj = configuration.createBean(listenerClass);

                for(Method method : listenerObj.getClass().getMethods()) {
                    if(annoReader.hasAnnotation(method, XlsPreLoad.class)) {
                        Utils.invokeNeedProcessMethod(listenerObj, method, beanObj, sheet, configuration, work.getErrors(), ProcessCase.Load);
                    }
                }
            }

        }

        // @PreLoad用のメソッドの実行
        for(Method method : clazz.getMethods()) {

            if(annoReader.hasAnnotation(method, XlsPreLoad.class)) {
                Utils.invokeNeedProcessMethod(beanObj, method, beanObj, sheet, configuration, work.getErrors(), ProcessCase.Load);
            }
        }

        final List<FieldAccessorProxy> accessorProxies = new ArrayList<>();

        // public メソッドの処理
        for(Method method : clazz.getMethods()) {
            method.setAccessible(true);
            for(Annotation anno : annoReader.getAnnotations(method)) {
                final XlsFieldProcessor annoFieldProcessor = anno.annotationType().getAnnotation(XlsFieldProcessor.class);
                if(ClassUtils.isAccessorMethod(method) && annoFieldProcessor != null) {
                    // 登録済みのFieldProcessorの取得
                    FieldProcessor<?> processor = configuration.getFieldProcessorRegistry().getProcessor(anno.annotationType());

                    // アノテーションに指定されているFieldProcessorの場合
                    if(processor == null && annoFieldProcessor.value().length > 0) {
                        processor = configuration.createBean(annoFieldProcessor.value()[0]);

                    }

                    if(processor != null) {
                        final FieldAccessor accessor = adpterFactory.create(method);
                        final FieldAccessorProxy accessorProxy = new FieldAccessorProxy(anno, processor, accessor);
                        if(!accessorProxies.contains(accessorProxy)) {
                            accessorProxies.add(accessorProxy);
                        }

                    } else {
                        // FieldProcessorが見つからない場合
                        throw new AnnotationInvalidException(anno, MessageBuilder.create("anno.XlsFieldProcessor.notResolve")
                                .varWithAnno("anno", anno.annotationType())
                                .format());
                    }

                }

                if(anno instanceof XlsPostLoad) {
                    work.addNeedPostProcess(new NeedProcess(beanObj, beanObj, method));
                }
            }

        }

        // フィールドの処理
        for(Field field : clazz.getDeclaredFields()) {

            field.setAccessible(true);
            for(Annotation anno : annoReader.getAnnotations(field)) {

                final XlsFieldProcessor annoFieldProcessor = anno.annotationType().getAnnotation(XlsFieldProcessor.class);
                if(annoFieldProcessor != null) {

                    // 登録済みのFieldProcessorの取得
                    FieldProcessor<?> processor = configuration.getFieldProcessorRegistry().getProcessor(anno.annotationType());

                    // アノテーションに指定されているFieldProcessorの場合
                    if(processor == null && annoFieldProcessor.value().length > 0) {
                        processor = configuration.createBean(annoFieldProcessor.value()[0]);

                    }

                    if(processor != null) {
                        final FieldAccessor accessor = adpterFactory.create(field);
                        final FieldAccessorProxy accessorProxy = new FieldAccessorProxy(anno, processor, accessor);
                        if(!accessorProxies.contains(accessorProxy)) {
                            accessorProxies.add(accessorProxy);
                        }

                    } else {
                        // FieldProcessorが見つからない場合
                        throw new AnnotationInvalidException(anno, MessageBuilder.create("anno.XlsFieldProcessor.notResolve")
                                .varWithAnno("anno", anno.annotationType())
                                .format());
                    }

                }


            }
        }

        // 順番を並び替えて保存処理を実行する
        Collections.sort(accessorProxies, new FieldAccessorProxyComparator());
        for(FieldAccessorProxy accessorProxy : accessorProxies) {
            accessorProxy.loadProcess(sheet, beanObj, configuration, work);
        }

        // リスナークラスの@PostLoadの取得
        if(listenerAnno != null) {
            for(Class<?> listenerClass : listenerAnno.value()) {
                Object listenerObj = configuration.createBean(listenerClass);
                for(Method method : listenerObj.getClass().getMethods()) {
                    if(annoReader.hasAnnotation(method, XlsPostLoad.class)) {
                        work.addNeedPostProcess(new NeedProcess(beanObj, listenerObj, method));
                    }
                }
            }

        }

        //@PostLoadが付与されているメソッドの実行
        for(NeedProcess need : work.getNeedPostProcesses()) {
            Utils.invokeNeedProcessMethod(need.getProcess(), need.getMethod(), need.getTarget(), sheet, configuration, work.getErrors(), ProcessCase.Load);
        }

        // セルのキャッシュ情報の初期化
        configuration.getCellFormatter().init(configuration.isCacheCellValueOnLoad());

        return errors;
    }
1028176
private static Class<?>[] getFields(Class<?> clz)
   {
      List<Class<?>> result = new ArrayList<Class<?>>();

      Class<?> c = clz;
      while (!c.equals(Object.class))
      {
         try
         {
            Field[] fields = SecurityActions.getDeclaredFields(c);
            if (fields.length > 0)
            {
               for (Field f : fields)
               {
                  Class<?> defClz = f.getType();
                  String defClzName = defClz.getName();

                  if (!defClz.isPrimitive() && !defClz.isArray() && 
                      !defClzName.startsWith("java") && !defClzName.startsWith("javax") && !result.contains(defClz))
                  {
                     if (trace)
                        log.tracef("Adding field: %s", defClzName);
                     
                     result.add(defClz);
                  }
               }
            }
         }
         catch (Throwable t)
         {
            // Ignore
         }

         c = c.getSuperclass();
      }

      return result.toArray(new Class<?>[result.size()]);
   }
136195
public static Field[] getAllFields(Class<?> clazz) {
        Assert.notNull(clazz, "clazz不能为空");
        return ALL_FIELD_CACHE.compute(clazz, (k, v) -> {
            if (v == null) {
                List<Field> fields = new ArrayList<>(Arrays.asList(clazz.getDeclaredFields()));

                //查找是否存在父类，如果存在且不是Object那么查找父类的field
                Class<?> superClass = clazz.getSuperclass();

                // 遍历设置访问权限，同时加入单个field的缓存
                fields.stream().map(ReflectUtil::allowAccess).forEach(
                    f -> FIELD_CACHE.compute(new FieldKey(f.getName(), clazz), (fk, fv) -> {
                        if (fv == null) {
                            return f;
                        } else {
                            return fv;
                        }
                    }));

                if (superClass != null && superClass != Object.class) {
                    fields.addAll(Arrays.asList(getAllFields(superClass)));
                }
                return fields.toArray(new Field[0]);
            } else {
                return v;
            }
        });
    }
243379
public static Method[] getAllMethod(Class<?> clazz) {
        if (clazz == null) {
            return null;
        }
        try {
            return clazz.getDeclaredMethods();
        } catch (SecurityException e) {
            e.printStackTrace();
        }
        return null;
    }
1343517
private void catalogClass(JavaClass clz) {
        transactionalMethods = new HashMap<>();
        isEntity = false;
        hasId = false;
        hasGeneratedValue = false;
        hasEagerOneToMany = false;
        hasHCEquals = false;

        for (AnnotationEntry entry : clz.getAnnotationEntries()) {
            if ("Ljavax/persistence/Entity;".equals(entry.getAnnotationType())) {
                isEntity = true;
                break;
            }
        }

        for (Method m : clz.getMethods()) {
            catalogFieldOrMethod(m);

            if (("equals".equals(m.getName()) && SignatureBuilder.SIG_OBJECT_TO_BOOLEAN.equals(m.getSignature()))
                    || (Values.HASHCODE.equals(m.getName()) && SignatureBuilder.SIG_VOID_TO_INT.equals(m.getSignature()))) {
                hasHCEquals = true;
            }
        }

        for (Field f : clz.getFields()) {
            catalogFieldOrMethod(f);
        }
    }
454908
public static Field getSoftDeleteColumn(Class<?> clazz) {
		List<Field> fields = getColumns(clazz);
		
		for(Field field : fields) {
			Column column = field.getAnnotation(Column.class);
			if(column.softDelete() != null && column.softDelete().length == 2
					&& !column.softDelete()[0].trim().isEmpty()
					&& !column.softDelete()[1].trim().isEmpty()) {
				return field;
			}
		}
		return null;
	}