Class UnsupportedNode<N extends UnsupportedNode<N>>
- java.lang.Object
-
- com.atlassian.adf.model.UnsupportedElement
-
- com.atlassian.adf.model.node.unsupported.UnsupportedNode<N>
-
public abstract class UnsupportedNode<N extends UnsupportedNode<N>> extends UnsupportedElement implements Node
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.atlassian.adf.model.Element
Element.Attr, Element.Key
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappendPlainText(StringBuilder sb)Renders this node as plain-text suitable for viewing by end users.static voidappendPlainTextForUnsupportedNode(Node node, StringBuilder sb)Ncopy()Returns a deep copy of this element, including copies of any nodes or marks that it contains.static StringplainTextFallback(Node node)StringtoPlainText()Renders this node as plain-text suitable for viewing by end users.-
Methods inherited from class com.atlassian.adf.model.UnsupportedElement
elementType, equals, hashCode, isSupported, toMap, toString, validate
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.atlassian.adf.model.Element
elementType, isSupported, toMap, validate
-
-
-
-
Method Detail
-
copy
public 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.
-
toPlainText
public String toPlainText()
Description copied from interface:NodeRenders this node as plain-text suitable for viewing by end users. Note that this is distinct from the more informativetoString()value, which is meant for debugging and logging, only.- Specified by:
toPlainTextin interfaceNode
-
appendPlainText
public void appendPlainText(StringBuilder sb)
Description copied from interface:NodeRenders this node as plain-text suitable for viewing by end users. This is equivalent to callingNode.toPlainText()and appending the result to the given buffer, except that it may be slightly more efficient, since it will write directly to the existing buffer instead of using a temporary buffer and having to make a copy of the result.- Specified by:
appendPlainTextin interfaceNode- Parameters:
sb- where to write the result
-
appendPlainTextForUnsupportedNode
public static void appendPlainTextForUnsupportedNode(Node node, StringBuilder sb)
-
-