com.github.xphsc.util.BeanUtil Maven / Gradle / Ivy
package com.github.xphsc.util;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.Method;
/**
* Created by ${huipei.x} on 2017-5-25.
*/
public class BeanUtil extends BeanUtils {
private BeanUtil() {
}
public static boolean isBean(Class> clazz) {
if(ClassUtil.isNormalClass(clazz)) {
Method[] methods = clazz.getMethods();
Method[] arr$ = methods;
int len$ = methods.length;
for(int i$ = 0; i$ < len$; ++i$) {
Method method = arr$[i$];
if(method.getParameterTypes().length == 1 && method.getName().startsWith("set")) {
return true;
}
}
}
return false;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy