Interface ExtensionNode<N extends ExtensionNode<N,M>,M extends Mark>
-
- All Known Implementing Classes:
BodiedExtension,Extension,InlineExtension
public interface ExtensionNode<N extends ExtensionNode<N,M>,M extends Mark> extends Marked<N,M>, Node
Describes features that are common to the various extension node types.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Ncopy()Returns a deep copy of this element, including copies of any nodes or marks that it contains.StringextensionKey()NextensionKey(String extensionKey)Replace the extension's key.StringextensionType()NextensionType(String extensionType)Replace the extension's type.Optional<String>localId()NlocalId(String localId)Replaces (or clears) the extension's local ID.Optional<Map<String,?>>parameters()Nparameters(Map<String,?> parameters)Replaces (or clears) the extension's parameter map.Optional<String>text()Ntext(String text)Replaces (or clears) the extension's text value.-
Methods inherited from interface com.atlassian.adf.model.Element
elementType, isSupported, toMap, validate
-
Methods inherited from interface com.atlassian.adf.model.node.type.Marked
mark, mark, markClass, marks, marks, markTypes
-
Methods inherited from interface com.atlassian.adf.model.node.Node
appendPlainText, toPlainText
-
-
-
-
Method Detail
-
copy
N 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.
-
extensionKey
String extensionKey()
- Returns:
- the extension's key
-
extensionKey
N extensionKey(String extensionKey)
Replace the extension's key.- Parameters:
extensionKey- the new extension key value; must not be empty- Returns:
this
-
extensionType
String extensionType()
- Returns:
- the extension's type
-
extensionType
N extensionType(String extensionType)
Replace the extension's type.- Parameters:
extensionType- the new extension type value; must not be empty- Returns:
this
-
localId
Optional<String> localId()
- Returns:
- the extension's local ID, or
emptyif it has not been set
-
localId
N localId(@Nullable String localId)
Replaces (or clears) the extension's local ID.- Parameters:
localId- the extension's new local ID, ornullto clear it.- Returns:
this
-
text
N text(@Nullable String text)
Replaces (or clears) the extension's text value.- Parameters:
text- the extension's new text value, ornullto clear it.- Returns:
this
-
parameters
Optional<Map<String,?>> parameters()
- Returns:
- the extension's parameter map, or
emptyif it has not been set
-
-