Class StreamingXlsxToCsvWriter.SheetToCsvHandler
java.lang.Object
org.xml.sax.helpers.DefaultHandler
io.jmix.reports.yarg.formatters.impl.streaming.StreamingXlsxToCsvWriter.SheetToCsvHandler
- All Implemented Interfaces:
ContentHandler,DTDHandler,EntityResolver,ErrorHandler
- Enclosing class:
StreamingXlsxToCsvWriter
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected booleanprotected @Nullable Stringprotected intprotected final StringBuilderprotected booleanprotected final com.opencsv.CSVWriter -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcharacters(char[] ch, int start, int length) protected intcolumnIndex(@Nullable String cellRef) Column index (0-based) parsed from a cell reference such asB3, or -1 when absent.voidendElement(String uri, String localName, String qName) protected StringformatNumeric(String raw) Normalizes a numeric<v>read back from the streamed workbook: a whole number without a trailing.0and never in scientific notation (the workbook stores every number as a double, so a plain integer would otherwise come out as5.0or1.2E12).protected booleanisNumericType(@Nullable String type) A numeric cell has notattribute ort="n"; strings/booleans/errors carry a type.voidstartElement(String uri, String localName, String qName, Attributes attributes) Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warningMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.xml.sax.ContentHandler
declaration
-
Field Details
-
writer
protected final com.opencsv.CSVWriter writer -
currentRow
-
currentValue
-
inValue
protected boolean inValue -
cellHasValue
protected boolean cellHasValue -
cellHasFormula
protected boolean cellHasFormula -
currentColumn
protected int currentColumn -
currentCellType
-
-
Constructor Details
-
SheetToCsvHandler
protected SheetToCsvHandler(com.opencsv.CSVWriter writer)
-
-
Method Details
-
startElement
- Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classDefaultHandler
-
characters
public void characters(char[] ch, int start, int length) - Specified by:
charactersin interfaceContentHandler- Overrides:
charactersin classDefaultHandler
-
endElement
- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classDefaultHandler
-
columnIndex
Column index (0-based) parsed from a cell reference such asB3, or -1 when absent. -
isNumericType
A numeric cell has notattribute ort="n"; strings/booleans/errors carry a type. -
formatNumeric
Normalizes a numeric<v>read back from the streamed workbook: a whole number without a trailing.0and never in scientific notation (the workbook stores every number as a double, so a plain integer would otherwise come out as5.0or1.2E12). Values beyond the exact-integer range of a double keep whatever precision the double preserved. This is close to, but not byte-identical with, the non-streaming engine's rawcell.getV()output (see the class Javadoc).
-