code: private static BeanProperty[][] getBeanProperties(Class beanType, PropertySet set) {
          List readProperties = new ArrayList();
          List writeProperties = new ArrayList();
  
          Map map = BeanIntrospector.getAllProperties(beanType);
  
          Iterator it = map.values().iterator();
          while (it.hasNext()) {
              BeanProperty bp = (BeanProperty)it.next();
  
              if (set == PropertySet.READ_WRITE ||
                  set == PropertySet.READ_WRITE_UNCHECKED_EXCEPTIONS)
              {
                  if (bp.getReadMethod() == null || bp.getWriteMethod() == null) {
                      continue;
                  }
              }
   
              boolean checkedAllowed = 
                  set != PropertySet.UNCHECKED_EXCEPTIONS &&
                  set != PropertySet.READ_WRITE_UNCHECKED_EXCEPTIONS;
  
              if (bp.getReadMethod() != null) {
                  if (checkedAllowed || !throwsCheckedException(bp.getReadMethod())) {
                      readProperties.add(bp);
                  }
              }
              if (bp.getWriteMethod() != null) {
                  if (checkedAllowed || !throwsCheckedException(bp.getWriteMethod())) {
                      writeProperties.add(bp);
                  }
              }
          }
  
          BeanProperty[][] props = new BeanProperty[2][];
          
          props[0] = new BeanProperty[readProperties.size()];
          readProperties.toArray(props[0]);
          props[1] = new BeanProperty[writeProperties.size()];
          writeProperties.toArray(props[1]);
  
          return props;
      }
docs: Returns two arrays of BeanProperties. Array 0 contains read
  BeanProperties, array 1 contains the write BeanProperties.