All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.vladsch.flexmark.ext.tables.TableBlock Maven / Gradle / Ivy

Go to download

flexmark-java extension for tables using "|" pipes with optional column spans and table caption

The newest version!
package com.vladsch.flexmark.ext.tables;

import com.vladsch.flexmark.util.ast.BlankLineBreakNode;
import com.vladsch.flexmark.util.ast.Block;
import com.vladsch.flexmark.util.ast.BlockContent;
import com.vladsch.flexmark.util.ast.Node;
import com.vladsch.flexmark.util.sequence.BasedSequence;
import java.util.List;
import org.jetbrains.annotations.NotNull;

/** Table block containing a {@link TableHead} and optionally a {@link TableBody}. */
public class TableBlock extends Block implements BlankLineBreakNode {
  public TableBlock() {}

  public TableBlock(BasedSequence chars) {
    super(chars);
  }

  public TableBlock(BasedSequence chars, List lineSegments) {
    super(chars, lineSegments);
  }

  public TableBlock(List lineSegments) {
    super(lineSegments);
  }

  public TableBlock(BlockContent blockContent) {
    super(blockContent);
  }

  @NotNull
  @Override
  public BasedSequence[] getSegments() {
    return new BasedSequence[0];
  }

  TableCaption getCaption() {
    Node child = getLastChild();
    return child instanceof TableCaption ? (TableCaption) child : null;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy