test_class.declarator: logger = LoggerFactory.getLogger(XlsSerializerTest.class)
test_class.modifier: private final static
test_class.original_string: private final static Logger logger = LoggerFactory.getLogger(XlsSerializerTest.class);
test_class.type: Logger
test_class.var_name: logger
test_class.declarator: parser
test_class.modifier: @Autowired
      private
test_class.original_string: @Autowired
      private XlsSchemaParser parser;
test_class.type: XlsSchemaParser
test_class.var_name: parser
test_class.file: dataprep-backend-service/src/test/java/org/talend/dataprep/schema/xls/XlsSchemaParserTest.java
test_class.identifier: XlsSchemaParserTest
test_class.superclass: extends AbstractSchemaTestUtils
test_case.body: @Test
      public void read_xls_TDP_1957() throws Exception {
  
          String fileName = "email_with_empty_rows.xlsx";
  
          try (InputStream inputStream = this.getClass().getResourceAsStream(fileName)) {
              List<ColumnMetadata> columnMetadatas =
                      parser.parse(getRequest(inputStream, "#852")).getSheetContents().get(0).getColumnMetadatas();
              assertThat(columnMetadatas).isNotNull().isNotEmpty().hasSize(2);
          }
  
      }
test_case.class_method_signature: XlsSchemaParserTest.read_xls_TDP_1957()
test_case.full_signature: @Test public void read_xls_TDP_1957()
test_case.identifier: read_xls_TDP_1957
test_case.invocations: getResourceAsStream getClass getColumnMetadatas get getSheetContents parse getRequest hasSize isNotEmpty isNotNull assertThat
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void read_xls_TDP_1957()
focal_class.declarator: LOGGER = LoggerFactory.getLogger(XlsSchemaParser.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = LoggerFactory.getLogger(XlsSchemaParser.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.declarator: BLANK = "blank"
focal_class.modifier: private static final
focal_class.original_string: private static final String BLANK = "blank";
focal_class.type: String
focal_class.var_name: BLANK
focal_class.declarator: maxNumberOfColumns
focal_class.modifier: @Value("${dataset.import.xls.size.column.max:1000}")
      private
focal_class.original_string: @Value("${dataset.import.xls.size.column.max:1000}")
      private int maxNumberOfColumns;
focal_class.type: int
focal_class.var_name: maxNumberOfColumns
focal_class.file: dataprep-backend-service/src/main/java/org/talend/dataprep/schema/xls/XlsSchemaParser.java
focal_class.identifier: XlsSchemaParser
focal_class.interfaces: implements SchemaParser
focal_class.class_method_signature: XlsSchemaParser.parse(Request request)
focal_class.full_signature: @Override public Schema parse(Request request)
focal_class.identifier: parse
focal_class.modifiers: @Override public
focal_class.parameters: (Request request)
focal_class.return: Schema
focal_class.signature: Schema parse(Request request)
focal_class.class_method_signature: XlsSchemaParser.parseAllSheets(Request request)
focal_class.full_signature: protected List<Schema.SheetContent> parseAllSheets(Request request)
focal_class.identifier: parseAllSheets
focal_class.modifiers: protected
focal_class.parameters: (Request request)
focal_class.return: List<Schema.SheetContent>
focal_class.signature: List<Schema.SheetContent> parseAllSheets(Request request)
focal_class.class_method_signature: XlsSchemaParser.parseAllSheetsStream(Request request)
focal_class.full_signature: private List<Schema.SheetContent> parseAllSheetsStream(Request request)
focal_class.identifier: parseAllSheetsStream
focal_class.modifiers: private
focal_class.parameters: (Request request)
focal_class.return: List<Schema.SheetContent>
focal_class.signature: List<Schema.SheetContent> parseAllSheetsStream(Request request)
focal_class.class_method_signature: XlsSchemaParser.getTotalColumnsNumber(StreamingSheet sheet)
focal_class.full_signature: private int getTotalColumnsNumber(StreamingSheet sheet)
focal_class.identifier: getTotalColumnsNumber
focal_class.modifiers: private
focal_class.parameters: (StreamingSheet sheet)
focal_class.return: int
focal_class.signature: int getTotalColumnsNumber(StreamingSheet sheet)
focal_class.class_method_signature: XlsSchemaParser.completeWithEmptyColumnsMetadata(List<ColumnMetadata> columnsMetadata, int maxColNumber)
focal_class.full_signature: private void completeWithEmptyColumnsMetadata(List<ColumnMetadata> columnsMetadata, int maxColNumber)
focal_class.identifier: completeWithEmptyColumnsMetadata
focal_class.modifiers: private
focal_class.parameters: (List<ColumnMetadata> columnsMetadata, int maxColNumber)
focal_class.return: void
focal_class.signature: void completeWithEmptyColumnsMetadata(List<ColumnMetadata> columnsMetadata, int maxColNumber)
focal_class.class_method_signature: XlsSchemaParser.createMetadataFromFirstNonEmptyRowAndInitSheet(Sheet sheet)
focal_class.full_signature: private List<ColumnMetadata> createMetadataFromFirstNonEmptyRowAndInitSheet(Sheet sheet)
focal_class.identifier: createMetadataFromFirstNonEmptyRowAndInitSheet
focal_class.modifiers: private
focal_class.parameters: (Sheet sheet)
focal_class.return: List<ColumnMetadata>
focal_class.signature: List<ColumnMetadata> createMetadataFromFirstNonEmptyRowAndInitSheet(Sheet sheet)
focal_class.class_method_signature: XlsSchemaParser.parseAllSheetsOldFormat(Request request)
focal_class.full_signature: private List<Schema.SheetContent> parseAllSheetsOldFormat(Request request)
focal_class.identifier: parseAllSheetsOldFormat
focal_class.modifiers: private
focal_class.parameters: (Request request)
focal_class.return: List<Schema.SheetContent>
focal_class.signature: List<Schema.SheetContent> parseAllSheetsOldFormat(Request request)
focal_class.class_method_signature: XlsSchemaParser.parsePerSheet(Sheet sheet, String datasetId, FormulaEvaluator formulaEvaluator)
focal_class.full_signature: private List<ColumnMetadata> parsePerSheet(Sheet sheet, String datasetId, FormulaEvaluator formulaEvaluator)
focal_class.identifier: parsePerSheet
focal_class.modifiers: private
focal_class.parameters: (Sheet sheet, String datasetId, FormulaEvaluator formulaEvaluator)
focal_class.return: List<ColumnMetadata>
focal_class.signature: List<ColumnMetadata> parsePerSheet(Sheet sheet, String datasetId, FormulaEvaluator formulaEvaluator)
focal_class.class_method_signature: XlsSchemaParser.guessColumnType(Integer colId, SortedMap<Integer, String> columnRows, int averageHeaderSize)
focal_class.full_signature: private Type guessColumnType(Integer colId, SortedMap<Integer, String> columnRows, int averageHeaderSize)
focal_class.identifier: guessColumnType
focal_class.modifiers: private
focal_class.parameters: (Integer colId, SortedMap<Integer, String> columnRows, int averageHeaderSize)
focal_class.return: Type
focal_class.signature: Type guessColumnType(Integer colId, SortedMap<Integer, String> columnRows, int averageHeaderSize)
focal_class.class_method_signature: XlsSchemaParser.collectSheetTypeMatrix(Sheet sheet,
              FormulaEvaluator formulaEvaluator)
focal_class.full_signature: private SortedMap<Integer, SortedMap<Integer, String>> collectSheetTypeMatrix(Sheet sheet,
              FormulaEvaluator formulaEvaluator)
focal_class.identifier: collectSheetTypeMatrix
focal_class.modifiers: private
focal_class.parameters: (Sheet sheet,
              FormulaEvaluator formulaEvaluator)
focal_class.return: SortedMap<Integer, SortedMap<Integer, String>>
focal_class.signature: SortedMap<Integer, SortedMap<Integer, String>> collectSheetTypeMatrix(Sheet sheet,
              FormulaEvaluator formulaEvaluator)
focal_class.class_method_signature: XlsSchemaParser.getTypeFromNumericCell(Cell cell)
focal_class.full_signature: private String getTypeFromNumericCell(Cell cell)
focal_class.identifier: getTypeFromNumericCell
focal_class.modifiers: private
focal_class.parameters: (Cell cell)
focal_class.return: String
focal_class.signature: String getTypeFromNumericCell(Cell cell)
focal_class.class_method_signature: XlsSchemaParser.guessHeaderSize(Map<Integer, SortedMap<Integer, String>> cellsTypeMatrix)
focal_class.full_signature: private int guessHeaderSize(Map<Integer, SortedMap<Integer, String>> cellsTypeMatrix)
focal_class.identifier: guessHeaderSize
focal_class.modifiers: private
focal_class.parameters: (Map<Integer, SortedMap<Integer, String>> cellsTypeMatrix)
focal_class.return: int
focal_class.signature: int guessHeaderSize(Map<Integer, SortedMap<Integer, String>> cellsTypeMatrix)
focal_method.body: @Override
      public Schema parse(Request request) {
          final Marker marker = Markers.dataset(request.getMetadata().getId());
          LOGGER.debug(marker, "parsing {} ");
          try {
              List<Schema.SheetContent> sheetContents = parseAllSheets(request);
              Schema result;
              if (!sheetContents.isEmpty()) {
                  // only one sheet
                  if (sheetContents.size() == 1) {
                      result = Schema.Builder
                              .parserResult() //
                              .sheetContents(sheetContents) //
                              .draft(false) //
                              .sheetName(sheetContents.get(0).getName()) //
                              .build();
                  } else {
                      // multiple sheet, set draft flag on
                      result = Schema.Builder
                              .parserResult() //
                              .sheetContents(sheetContents) //
                              .draft(true) //
                              .sheetName(sheetContents.get(0).getName()) //
                              .build();
                  }
              }
              // nothing to parse
              else {
                  throw new TDPException(DataSetErrorCodes.UNABLE_TO_READ_DATASET_CONTENT);
              }
              return result;
          } catch (TDPException e) {
              throw e;
          } catch (Exception e) {
              LOGGER.debug(marker, "IOException during parsing xls request :" + e.getMessage(), e);
              throw new TDPException(CommonErrorCodes.UNEXPECTED_EXCEPTION, e);
          }
  
      }
focal_method.class_method_signature: XlsSchemaParser.parse(Request request)
focal_method.full_signature: @Override public Schema parse(Request request)
focal_method.identifier: parse
focal_method.invocations: dataset getId getMetadata debug parseAllSheets isEmpty size build sheetName draft sheetContents parserResult getName get build sheetName draft sheetContents parserResult getName get debug getMessage
focal_method.modifiers: @Override public
focal_method.parameters: (Request request)
focal_method.return: Schema
focal_method.signature: Schema parse(Request request)