Package com.atlassian.adf.model.node
Class TableCell
- java.lang.Object
-
- com.atlassian.adf.model.node.AbstractNode<C>
-
- com.atlassian.adf.model.node.AbstractContentNode<N,TableCellContent>
-
- com.atlassian.adf.model.node.AbstractTableCellNode<TableCell>
-
- com.atlassian.adf.model.node.TableCell
-
- All Implemented Interfaces:
Element,Node,ContentNode<TableCell,TableCellContent>,TableCellNode<TableCell>,TableRowContent
@Documentation(state=REVIEWED, date="2023-07-26") public class TableCell extends AbstractTableCellNode<TableCell>
A table cell within a table row.⚠️ WARNING: Tables are documented as supported on web and desktop only. Mobile rendering support for tables may be restricted or entirely unavailable.Example
Java
td(p("Hello world"));ADF
{ "type": "tableCell", "content": [ { "type": "paragraph", "content": [ { "type": "text", "text": "Hello world" } ] } ] }Result
Hello world
- See Also:
- Node - tableCell
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.atlassian.adf.model.node.AbstractNode
AbstractNode.ToStringHelper
-
-
Field Summary
-
Fields inherited from class com.atlassian.adf.model.node.AbstractTableCellNode
background, colspan, colwidth, rowspan
-
Fields inherited from class com.atlassian.adf.model.node.AbstractContentNode
content
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description TableCellcopy()Returns a deep copy of this element, including copies of any nodes or marks that it contains.StringelementType()Thetypevalue that identifies this element, such as"paragraph"or"strong".booleanisHeader()Returnsfalseunconditionally, because this is an ordinary table cell.static TableCelltableCell()static TableCelltableCell(TableCellContent content)static TableCelltableCell(TableCellContent... content)static TableCelltableCell(Iterable<? extends TableCellContent> content)static TableCelltableCell(Stream<? extends TableCellContent> content)static TableCelltd()static TableCelltd(TableCellContent content)static TableCelltd(TableCellContent... content)static TableCelltd(Iterable<? extends TableCellContent> content)static TableCelltd(String content)static TableCelltd(String... content)static TableCelltd(Stream<? extends TableCellContent> content)-
Methods inherited from class com.atlassian.adf.model.node.AbstractTableCellNode
appendContentNodeFields, appendPlainText, background, background, colspan, colspan, colspanAndColwidth, colwidth, colwidth, content, content, contentClass, contentNodeEquals, contentNodeHashCode, contentNodeValidate, parseTableNode, rowspan, rowspan, toMap, validateContentNodeForAppend
-
Methods inherited from class com.atlassian.adf.model.node.AbstractContentNode
addContent, addContentIfPresent, allNodes, appendNodeFields, appendPlainTextContentJoinedWith, appendPlainTextInlineContent, clear, content, content, content, content, content, contentFieldMaps, isEmpty, nodeEquals, nodeHashCode, parseContentItem, parseContentItems, parseOptionalContent, parseRequiredContent, parseRequiredContentAllowEmpty, removeIf, replaceContent, requireNotEmpty, transformContent, transformDescendants, trim, validate, validateContentItems
-
Methods inherited from class com.atlassian.adf.model.node.AbstractNode
doubleEq, doubleHash, equals, hashCode, isSupported, mapWithType, numberEq, numberHash, self, toPlainText, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.atlassian.adf.model.node.type.ContentNode
allNodes, allNodesOfType, allNodesOfTypeAsList, clear, content, content, content, content, content, isEmpty, removeIf, replaceContent, transformContent, transformDescendants
-
Methods inherited from interface com.atlassian.adf.model.Element
isSupported, validate
-
Methods inherited from interface com.atlassian.adf.model.node.Node
toPlainText
-
-
-
-
Method Detail
-
td
public static TableCell td()
- Returns:
- a new, empty table cell. At least one content item must be added to make the table cell valid.
-
td
public static TableCell td(String content)
- Returns:
- a new table cell with the given string wrapped in a
Paragraphas content
-
td
public static TableCell td(String... content)
- Returns:
- a new table cell with the given strings wrapped in a
Paragraphas content
-
td
public static TableCell td(TableCellContent content)
- Returns:
- a new table cell with the given content
-
td
public static TableCell td(TableCellContent... content)
- Returns:
- a new table cell with the given content
-
td
public static TableCell td(Iterable<? extends TableCellContent> content)
- Returns:
- a new table cell with the given content
-
td
public static TableCell td(Stream<? extends TableCellContent> content)
- Returns:
- a new table cell with the given content
-
tableCell
public static TableCell tableCell(TableCellContent content)
- See Also:
td(TableCellContent)
-
tableCell
public static TableCell tableCell(TableCellContent... content)
- See Also:
td(TableCellContent[])
-
tableCell
public static TableCell tableCell(Iterable<? extends TableCellContent> content)
- See Also:
td(Iterable)
-
tableCell
public static TableCell tableCell(Stream<? extends TableCellContent> content)
- See Also:
td(Stream)
-
copy
public TableCell copy()
Description copied from interface:ElementReturns a deep copy of this element, including copies of any nodes or marks that it contains. The copy will not necessarily be in exactly the same state as the original in some cases. For example, atextnode that is used inside acodeBlockwill have the ability to use marks on it disabled, but a copy made of the text node using this method will not similarly disallow marks unless it is also added to a content node with those same restrictions.Implementations notes:
- Implementations should narrow the return type.
- Implementations should
return thisif the element is immutable. The@Immutableannotation should be used on the class to offer additional confirmation of this intent. - Implementations should
return parse(toMap())if they have state. - While there may be cases where it is worthwhile to do something more efficient than
the conversion to a map and back, this is discouraged because it would add yet another
fragile piece of code that breaks when new data is added to the node. The
parseandtoMapmethods already have to be updated in these circumstances, so it makes sense to take advantage of that.
- Returns:
- a copy of this element, or
thisif the element is immutable anyway
-
elementType
public String elementType()
Description copied from interface:ElementThetypevalue that identifies this element, such as"paragraph"or"strong".
-
isHeader
public boolean isHeader()
Returnsfalseunconditionally, because this is an ordinary table cell.- Returns:
falseunconditionally, because this is an ordinary table cell.
-
-