test_class.file: dataprep-backend-service/src/test/java/org/talend/dataprep/schema/xls/XlsUtilsTest.java
test_class.identifier: XlsUtilsTest
test_case.body: @Test
      public void get_ColumnsNumber() throws Exception {
          Assertions
                  .assertThat(XlsUtils.getColumnsNumber(getClass().getResourceAsStream("data_xls.xml"))) //
                  .isEqualTo(33);
  
          Assertions
                  .assertThat(XlsUtils.getColumnsNumber(getClass().getResourceAsStream("simple_data.xml"))) //
                  .isEqualTo(4);
  
          Assertions
                  .assertThat(XlsUtils.getColumnsNumber(getClass().getResourceAsStream("TDP-1781.xml"))) //
                  .isEqualTo(6);
      }
test_case.class_method_signature: XlsUtilsTest.get_ColumnsNumber()
test_case.full_signature: @Test public void get_ColumnsNumber()
test_case.identifier: get_ColumnsNumber
test_case.invocations: isEqualTo assertThat getColumnsNumber getResourceAsStream getClass isEqualTo assertThat getColumnsNumber getResourceAsStream getClass isEqualTo assertThat getColumnsNumber getResourceAsStream getClass
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void get_ColumnsNumber()
focal_class.declarator: LOGGER = LoggerFactory.getLogger(XlsUtils.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = LoggerFactory.getLogger(XlsUtils.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.declarator: XML_INPUT_FACTORY = XMLInputSingletonHolder.xmlInputFactory
focal_class.modifier: private static final
focal_class.original_string: private static final XMLInputFactory XML_INPUT_FACTORY = XMLInputSingletonHolder.xmlInputFactory;
focal_class.type: XMLInputFactory
focal_class.var_name: XML_INPUT_FACTORY
focal_class.file: dataprep-backend-service/src/main/java/org/talend/dataprep/schema/xls/XlsUtils.java
focal_class.identifier: XlsUtils
focal_class.class_method_signature: XlsUtils.XlsUtils()
focal_class.full_signature: private  XlsUtils()
focal_class.identifier: XlsUtils
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  XlsUtils()
focal_class.class_method_signature: XlsUtils.getCellValueAsString(Cell cell, FormulaEvaluator formulaEvaluator)
focal_class.full_signature: public static String getCellValueAsString(Cell cell, FormulaEvaluator formulaEvaluator)
focal_class.identifier: getCellValueAsString
focal_class.modifiers: public static
focal_class.parameters: (Cell cell, FormulaEvaluator formulaEvaluator)
focal_class.return: String
focal_class.signature: String getCellValueAsString(Cell cell, FormulaEvaluator formulaEvaluator)
focal_class.class_method_signature: XlsUtils.getCellValueAsString(Cell cell, CellValue cellValue)
focal_class.full_signature: private static String getCellValueAsString(Cell cell, CellValue cellValue)
focal_class.identifier: getCellValueAsString
focal_class.modifiers: private static
focal_class.parameters: (Cell cell, CellValue cellValue)
focal_class.return: String
focal_class.signature: String getCellValueAsString(Cell cell, CellValue cellValue)
focal_class.class_method_signature: XlsUtils.getNumericValue(Cell cell, CellValue cellValue, boolean fromFormula)
focal_class.full_signature: private static String getNumericValue(Cell cell, CellValue cellValue, boolean fromFormula)
focal_class.identifier: getNumericValue
focal_class.modifiers: private static
focal_class.parameters: (Cell cell, CellValue cellValue, boolean fromFormula)
focal_class.return: String
focal_class.signature: String getNumericValue(Cell cell, CellValue cellValue, boolean fromFormula)
focal_class.class_method_signature: XlsUtils.isNewExcelFormat(InputStream inputStream)
focal_class.full_signature: public static boolean isNewExcelFormat(InputStream inputStream)
focal_class.identifier: isNewExcelFormat
focal_class.modifiers: public static
focal_class.parameters: (InputStream inputStream)
focal_class.return: boolean
focal_class.signature: boolean isNewExcelFormat(InputStream inputStream)
focal_class.class_method_signature: XlsUtils.getActiveSheetsFromWorkbookSpec(InputStream inputStream)
focal_class.full_signature: public static List<String> getActiveSheetsFromWorkbookSpec(InputStream inputStream)
focal_class.identifier: getActiveSheetsFromWorkbookSpec
focal_class.modifiers: public static
focal_class.parameters: (InputStream inputStream)
focal_class.return: List<String>
focal_class.signature: List<String> getActiveSheetsFromWorkbookSpec(InputStream inputStream)
focal_class.class_method_signature: XlsUtils.getColumnsNumber(InputStream inputStream)
focal_class.full_signature: public static int getColumnsNumber(InputStream inputStream)
focal_class.identifier: getColumnsNumber
focal_class.modifiers: public static
focal_class.parameters: (InputStream inputStream)
focal_class.return: int
focal_class.signature: int getColumnsNumber(InputStream inputStream)
focal_class.class_method_signature: XlsUtils.getAttributesNameValue(XMLStreamReader streamReader)
focal_class.full_signature: private static Map<String, String> getAttributesNameValue(XMLStreamReader streamReader)
focal_class.identifier: getAttributesNameValue
focal_class.modifiers: private static
focal_class.parameters: (XMLStreamReader streamReader)
focal_class.return: Map<String, String>
focal_class.signature: Map<String, String> getAttributesNameValue(XMLStreamReader streamReader)
focal_class.class_method_signature: XlsUtils.getColumnsNumberFromDimension(String dimension)
focal_class.full_signature: public static int getColumnsNumberFromDimension(String dimension)
focal_class.identifier: getColumnsNumberFromDimension
focal_class.modifiers: public static
focal_class.parameters: (String dimension)
focal_class.return: int
focal_class.signature: int getColumnsNumberFromDimension(String dimension)
focal_class.class_method_signature: XlsUtils.getColumnNumberFromCellRef(String lastCell)
focal_class.full_signature: public static int getColumnNumberFromCellRef(String lastCell)
focal_class.identifier: getColumnNumberFromCellRef
focal_class.modifiers: public static
focal_class.parameters: (String lastCell)
focal_class.return: int
focal_class.signature: int getColumnNumberFromCellRef(String lastCell)
focal_method.body: public static int getColumnsNumber(InputStream inputStream) throws XMLStreamException, IOException {
          // If doesn't support mark, wrap up
          if (!inputStream.markSupported()) {
              inputStream = new PushbackInputStream(inputStream, 8);
          }
  
          int colNumber = 0;
  
          // TDP-1781 xlsx files may not containing dimension so we fallback to col element number
  
          XMLStreamReader streamReader = XML_INPUT_FACTORY.createXMLStreamReader(inputStream);
          try {
              while (streamReader.hasNext()) {
                  switch (streamReader.next()) {
                  case START_ELEMENT:
                      if (StringUtils.equals(streamReader.getLocalName(), "dimension")) {
                          Map<String, String> attributesValues = getAttributesNameValue(streamReader);
                          if (!attributesValues.isEmpty()) {
                              return getColumnsNumberFromDimension(attributesValues.get("ref"));
                          }
                      }
                      if (StringUtils.equals(streamReader.getLocalName(), "col")) {
                          colNumber++;
                      }
                      break;
                  case END_ELEMENT:
                      if (StringUtils.equals(streamReader.getLocalName(), "cols")) {
                          return colNumber;
                      }
                  default:
                      // no op
                  }
              }
          } finally {
              if (streamReader != null) {
                  streamReader.close();
              }
          }
          return -1;
      }
focal_method.class_method_signature: XlsUtils.getColumnsNumber(InputStream inputStream)
focal_method.full_signature: public static int getColumnsNumber(InputStream inputStream)
focal_method.identifier: getColumnsNumber
focal_method.invocations: markSupported createXMLStreamReader hasNext next equals getLocalName getAttributesNameValue isEmpty getColumnsNumberFromDimension get equals getLocalName equals getLocalName close
focal_method.modifiers: public static
focal_method.parameters: (InputStream inputStream)
focal_method.return: int
focal_method.signature: int getColumnsNumber(InputStream inputStream)