Package org.formulacompiler.spreadsheet.internal.odf.xml.stream

Examples of org.formulacompiler.spreadsheet.internal.odf.xml.stream.ElementWriter


  public void write( String _text ) throws XMLStreamException
  {
    final int length = _text.length();
    final CharWriter charWriter = new CharWriter();
    final SpaceWriter spaceWriter = new SpaceWriter();
    final ElementWriter tabWriter = new ElementWriter(
        getXmlEventFactory(), getXmlEventWriter(), XMLConstants.Text.TAB );
    startElement( null );
    for (int i = 0; i < length; i++) {
      final char c = _text.charAt( i );
      switch (c) {
        case '\n':
        case '\r':
          spaceWriter.flush();
          charWriter.flush();
          endElement();
          startElement( null );
          break;
        case '\t':
          spaceWriter.flush();
          charWriter.flush();
          tabWriter.startElement( null );
          tabWriter.endElement();
          break;
        case ' ':
          charWriter.flush();
          spaceWriter.add();
          break;
View Full Code Here


      }
    }

    final Map<String, CellRange> modelRangeNames = _spreadsheet.getModelRangeNames();
    if (modelRangeNames != null && !modelRangeNames.isEmpty()) {
      final ElementWriter elementWriter = new ElementWriter( getXmlEventFactory(), getXmlEventWriter(),
          XMLConstants.Table.NAMED_EXPRESSIONS );
      elementWriter.startElement( null );

      {
        final NamedRangeWriter namedRangeWriter = new NamedRangeWriter( getXmlEventFactory(), getXmlEventWriter() );
        for (Map.Entry<String, CellRange> nameDefinition : modelRangeNames.entrySet()) {
          namedRangeWriter.write( nameDefinition.getKey(), nameDefinition.getValue() );
        }
      }

      elementWriter.endElement();
    }

    endElement();
  }
View Full Code Here

      }
    }

    startElement( attributes );

    final ElementWriter columnWriter = new ElementWriter( getXmlEventFactory(), getXmlEventWriter(), XMLConstants.Table.TABLE_COLUMN );
    columnWriter.startElement( null );
    columnWriter.endElement();

    final RowWriter rowWriter = new RowWriter( getXmlEventFactory(), getXmlEventWriter(), this.timeZone, this.styles );
    boolean rowWritten = false;
    if (_sheet != null) {
      final List<? extends BaseRow> rows = _sheet.getRowList();
View Full Code Here

TOP

Related Classes of org.formulacompiler.spreadsheet.internal.odf.xml.stream.ElementWriter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.