public static PropertyInfo[] extractBeanPropertiesInfo(Type type){
  Class<?> rawType=getRawType(type);
  List<PropertyInfo> result=new ArrayList<PropertyInfo>();
  List<Method> getterMethods=getGetterMethods(rawType);
  List<Method> setterMethods=getSetterMethods(rawType);
  try {
    for (    Method setterMethod : setterMethods) {
      String setterProperty=getPropertyForGetterOrSetterMethod(setterMethod);
      for (      Method getterMethod : getterMethods) {
        String getterProperty=getPropertyForGetterOrSetterMethod(getterMethod);
        if (getterProperty.equals(setterProperty)) {
          Type returnType=getterMethod.getGenericReturnType();
          Type propertyType=getPropertyType(returnType,type,rawType);
          result.add(new PropertyInfo(setterProperty,propertyType,getterMethod,setterMethod));
          break;
        }
      }
    }
  }
 catch (  Exception e) {
    throw new RuntimeException("Unable to determine properties for bean: " + rawType.getCanonicalName(),e);
  }
  return result.toArray(new PropertyInfo[result.size()]);
}

public static PropertyInfo [ ] extractBeanPropertiesInfo ( Type type ) { Class < ? > rawType = getRawType ( type ) ; List < PropertyInfo > result = new ArrayList < PropertyInfo > ( ) ; List < Method > getterMethods = getGetterMethods ( rawType ) ; List < Method > setterMethods = getSetterMethods ( rawType ) ; try { for ( Method setterMethod : setterMethods ) { String setterProperty = getPropertyForGetterOrSetterMethod ( setterMethod ) ; for ( Method getterMethod : getterMethods ) { String getterProperty = getPropertyForGetterOrSetterMethod ( getterMethod ) ; if ( getterProperty . equals ( setterProperty ) ) { Type returnType = getterMethod . getGenericReturnType ( ) ; Type propertyType = getPropertyType ( returnType , type , rawType ) ; result . add ( new PropertyInfo ( setterProperty , propertyType , getterMethod , setterMethod ) ) ; break ; } } } } catch ( Exception e ) { throw new RuntimeException ( "Unable to determine properties for bean: " + rawType . getCanonicalName ( ) , e ) ; } return result . toArray ( new PropertyInfo [ result . size ( ) ] ) ; }
workaround for jvm bug - http : / / codereligion . com / post / 28703017143 / beware - of - java - beans - introspector
