Package com.atlassian.adf.model.node
Class Expand
- java.lang.Object
-
- com.atlassian.adf.model.node.AbstractNode<C>
-
- com.atlassian.adf.model.node.AbstractContentNode<C,N>
-
- com.atlassian.adf.model.node.AbstractMarkedContentNode<Expand,NonNestableBlockContent,ExpandMark>
-
- com.atlassian.adf.model.node.Expand
-
- All Implemented Interfaces:
Element,Node,ContentNode<Expand,NonNestableBlockContent>,DocContent,LayoutColumnContent,Marked<Expand,ExpandMark>
@Documentation(state=UNDOCUMENTED, date="2023-07-26") public class Expand extends AbstractMarkedContentNode<Expand,NonNestableBlockContent,ExpandMark> implements DocContent, LayoutColumnContent
Theexpandnode is a container that enables content to be hidden or shown, similar to an accordion or disclosure widget.Note: To add an expand to a table (
tableCellortableHeader) usenestedExpandinstead.Example
Java
expand(p("Hello world") );ADF
{ "type": "expand", "attrs": { "title": "Hello world" }, "content": [ { "type": "paragraph", "content": [ { "type": "text", "text": "Hello world" } ] } ] }
-
-
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.AbstractMarkedContentNode
marks
-
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 protected voidappendMarkedContentNodeFields(AbstractNode.ToStringHelper buf)Optional<Breakout>breakout()Expandbreakout(Breakout breakout)Class<NonNestableBlockContent>contentClass()ReturnsClass<N>, the class representing the type of items held by this node.Expandcopy()Returns a deep copy of this element, including copies of any nodes or marks that it contains.ExpanddefaultWidth()StringelementType()Thetypevalue that identifies this element, such as"paragraph"or"strong".static Expandexpand()static Expandexpand(NonNestableBlockContent content)static Expandexpand(NonNestableBlockContent... content)static Expandexpand(Iterable<? extends NonNestableBlockContent> content)static Expandexpand(Stream<? extends NonNestableBlockContent> content)ExpandfullWidth()Class<ExpandMark>markClass()Returns the type of marks that may be applied to this node.protected booleanmarkedContentNodeEquals(Expand other)protected intmarkedContentNodeHashCode()protected voidmarkedContentNodeValidate()Optional<String>title()Expandtitle(String title)Map<String,?>toMap()Transforms this element to a map ofStringvalues to various basic object types suitable for direct rendering as JSON content.protected voidvalidateContentNodeForAppend(NonNestableBlockContent node)Called on each content node before it is added to validate that the node can be accepted.Expandwide()-
Methods inherited from class com.atlassian.adf.model.node.AbstractMarkedContentNode
appendContentNodeFields, contentNodeEquals, contentNodeHashCode, contentNodeValidate, createMarkHolder, mark, mark, marks, marks, markTypes, parseMarks, unsupportedMarkFactory
-
Methods inherited from class com.atlassian.adf.model.node.AbstractContentNode
addContent, addContentIfPresent, allNodes, appendNodeFields, appendPlainText, 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
appendPlainText, toPlainText
-
-
-
-
Method Detail
-
expand
public static Expand expand()
-
expand
public static Expand expand(NonNestableBlockContent content)
-
expand
public static Expand expand(NonNestableBlockContent... content)
-
expand
public static Expand expand(Iterable<? extends NonNestableBlockContent> content)
-
expand
public static Expand expand(Stream<? extends NonNestableBlockContent> content)
-
contentClass
public Class<NonNestableBlockContent> contentClass()
Description copied from interface:ContentNodeReturnsClass<N>, the class representing the type of items held by this node.- Specified by:
contentClassin interfaceContentNode<Expand,NonNestableBlockContent>
-
copy
public Expand 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.
- Specified by:
copyin interfaceContentNode<Expand,NonNestableBlockContent>- Specified by:
copyin interfaceElement- Specified by:
copyin interfaceMarked<Expand,ExpandMark>- Specified by:
copyin interfaceNode- 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".- Specified by:
elementTypein interfaceElement
-
markClass
public Class<ExpandMark> markClass()
Description copied from interface:MarkedReturns the type of marks that may be applied to this node.- Specified by:
markClassin interfaceMarked<Expand,ExpandMark>- Specified by:
markClassin classAbstractMarkedContentNode<Expand,NonNestableBlockContent,ExpandMark>- Returns:
- the type of marks that may be applied to this node, which is the concrete type for the generic
type
<M>on this interface.
-
markedContentNodeValidate
protected void markedContentNodeValidate()
- Overrides:
markedContentNodeValidatein classAbstractMarkedContentNode<Expand,NonNestableBlockContent,ExpandMark>
-
validateContentNodeForAppend
protected void validateContentNodeForAppend(NonNestableBlockContent node)
Description copied from class:AbstractContentNodeCalled on each content node before it is added to validate that the node can be accepted.- Overrides:
validateContentNodeForAppendin classAbstractContentNode<Expand,NonNestableBlockContent>- Parameters:
node- the node that is about to be added
-
wide
public Expand wide()
-
fullWidth
public Expand fullWidth()
-
defaultWidth
public Expand defaultWidth()
-
markedContentNodeEquals
protected boolean markedContentNodeEquals(Expand other)
- Overrides:
markedContentNodeEqualsin classAbstractMarkedContentNode<Expand,NonNestableBlockContent,ExpandMark>
-
markedContentNodeHashCode
protected int markedContentNodeHashCode()
- Overrides:
markedContentNodeHashCodein classAbstractMarkedContentNode<Expand,NonNestableBlockContent,ExpandMark>
-
appendMarkedContentNodeFields
protected void appendMarkedContentNodeFields(AbstractNode.ToStringHelper buf)
- Overrides:
appendMarkedContentNodeFieldsin classAbstractMarkedContentNode<Expand,NonNestableBlockContent,ExpandMark>
-
-