com.vladsch.flexmark.ext.tables.TableBlock Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of flexmark-ext-tables Show documentation
Show all versions of flexmark-ext-tables Show documentation
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;
}
}