【仅供内部供应商使用,不提供对外解答和培训】

Page tree

【仅供内部供应商使用,不提供对外解答和培训】

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

接口作用

MongoDB中,列的类型不同(Array类型,Object类型),在转换成为二维表的时候,就会有不同的处理方式。

接口内容

package com.fr.plugin.db.mongo.expand;

import com.fr.stable.fun.mark.Mutable;
import org.bson.Document;

import java.util.List;

/**
 * Created by richie on 2017/5/8.
 * 不是通常的基本类型的列的处理
 */
public interface ColumnResolver extends Mutable {

    String MARK_STRING = "ColumnResolver";

    int CURRENT_LEVEL = 1;

    /**
     * 是否需要处理该类型的元素
     *
     * @param cell doc查询出来的对象
     * @return 需要做扩展处理则返回true,否则返回false
     */
    boolean accept(Object cell);


    /**
     * 扩展特殊列,增加新的行
     *
     * @param doc                 MongoDB的文档查询对象
     * @param columnNames         列民集合
     * @param waitingColumnsIndex 需要特殊处理的列集合
     * @param rowDataCollections  扩展出来的行数据集合
     * @param rowData             当前行数据
     */
    void expandData(Document doc, List<String> columnNames, List<Integer> waitingColumnsIndex, List<List<Object>> rowDataCollections, List<Object> rowData);
}

 

 

  • No labels