code: private static Column getCurrentResourceColumn(DataSource dataSource, Integer size,
        Resource currentResource, String itemResourceType) {
  
      Iterator<Resource> items = dataSource.iterator();
  
      boolean hasMore = false;
      if (size != null) {
        List<Resource> list = new ArrayList<Resource>();
        while (items.hasNext() && list.size() < size) {
          list.add(items.next());
        }
        hasMore = items.hasNext();
        items = list.iterator();
      }
  
      Column column = new Column()
          .columnId(currentResource.getPath())
          .hasMore(hasMore)
          .metaElement(true);
      while (items.hasNext()) {
        Resource item = items.next();
        column.addItem(new ColumnItem(item)
            .resourceType(itemResourceType));
      }
  
      return column;
    }
docs: Generate column for data source items for current resource.
  @param dataSource Data source
  @param size Size limit
  @param currentResource Current resource
  @param itemResourceType Item resource type
  @return Column