Interface TextMark
-
- All Known Subinterfaces:
CodeTextMark,FormattedTextMark
- All Known Implementing Classes:
Annotation,Code,Em,Link,Strike,Strong,SubSup,TextColor,Underline,UnsupportedTextMark
public interface TextMark extends Mark
Any mark that is assignable totextnodes.These are split into two groups, the
formatted-textandcodemarks. A given text node is only allowed to use marks from one of these groups at a time, although there are some marks that are marked with both interfaces and can therefore be used in either group.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.atlassian.adf.model.Element
Element.Key
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TextMarkcopy()Returns a deep copy of this element, including copies of any nodes or marks that it contains.-
Methods inherited from interface com.atlassian.adf.model.Element
elementType, isSupported, toMap, validate
-
-
-
-
Method Detail
-
copy
TextMark 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.
-
-