public class NodeContext extends Object
This class is only used in the WysiwygMacroHelper at the moment and should be eventually
used in DefaultWysiwygConverter instead of passing so many parameters around.
| Modifier and Type | Class and Description |
|---|---|
static class |
NodeContext.Builder
Builder to help construct new NodeContexts.
|
| Constructor and Description |
|---|
NodeContext(Node node,
Node previousSibling,
Styles styles,
ListContext listContext,
boolean inTable,
boolean inListItem,
boolean ignoreText,
boolean escapeWikiMarkup)
Deprecated.
Since 6.0 use NodeContext#Builder to build NodeContexts instead.
This constructor does not allow setting the
inHeading. |
| Modifier and Type | Method and Description |
|---|---|
String |
getAttribute(String name)
Retrieve the attribute value from the node.
|
boolean |
getBooleanAttributeValue(String attributeName,
boolean defaultValue)
Retrieve the value of an attribute from the node as a boolean.
|
NodeContext |
getFirstChildNodeContext() |
NodeContext |
getFirstChildNodeContextPreservingPreviousSibling() |
ListContext |
getListContext() |
Node |
getNode() |
NodeContext |
getNodeContextForNextChild(NodeContext child)
Get a node context for the child of this context after the given one.
|
NodeContext |
getNodeContextForNextChildPreservingPreviousSibling(NodeContext child)
Get a node context for the child after the given one, but keep the previous sibling set in the child context.
|
String |
getNodeName()
Returns the name of the node in all lower case.
|
Node |
getPreviousSibling() |
Styles |
getStyles() |
boolean |
hasClass(String className)
Check the "class" attribute for a specific class
|
boolean |
hasNodeName(String nodeName)
Return true if the node name matches the given string.
|
String |
invokeConvert(WysiwygNodeConverter wysiwygNodeConverter,
WysiwygConverter wysiwygConverter) |
boolean |
isEscapeWikiMarkup() |
boolean |
isIgnoreText() |
boolean |
isInHeading() |
boolean |
isInListItem() |
boolean |
isInTable() |
public NodeContext(Node node, Node previousSibling, Styles styles, ListContext listContext, boolean inTable, boolean inListItem, boolean ignoreText, boolean escapeWikiMarkup)
inHeading.public NodeContext getFirstChildNodeContext()
public NodeContext getFirstChildNodeContextPreservingPreviousSibling()
public NodeContext getNodeContextForNextChild(NodeContext child)
child - a childContext of this object.public NodeContext getNodeContextForNextChildPreservingPreviousSibling(NodeContext child)
child - a childContext of this object.public String invokeConvert(WysiwygNodeConverter wysiwygNodeConverter, WysiwygConverter wysiwygConverter)
public boolean hasClass(String className)
public Node getNode()
public Node getPreviousSibling()
public Styles getStyles()
public ListContext getListContext()
public boolean isInTable()
public boolean isInListItem()
public boolean isInHeading()
public boolean isIgnoreText()
public boolean isEscapeWikiMarkup()
public boolean getBooleanAttributeValue(String attributeName, boolean defaultValue)
attributeName - the attribute to find the value ofdefaultValue - the value to return if no boolean value is found.public String getAttribute(String name)
public String getNodeName()
public boolean hasNodeName(String nodeName)
Copyright © 2019 Atlassian. All rights reserved.