java.lang.Object | |
↳ | com.atlassian.jira.functest.framework.util.dom.DomKit |
This is some methods to manipulate the DOM and text in it
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
This returns a org.w3c.dom.Node implementation that has better toString() attached to it.
| |||||||||||
This will copy the Node' s from srcNode into a new org.w3c.dom.DocumentFragment
| |||||||||||
Returns the first BODY element of the Document or null if there isnt one
| |||||||||||
Returns the collapsed text of the specified Node.
| |||||||||||
This will return an "canonical" version of the HTML that makes up the given org.w3c.dom.Element, including itself.
| |||||||||||
Returns the first HTML element of the Document or null if there isnt one
| |||||||||||
This will return an "canonical" version of the HTML that makes up the given org.w3c.dom.Node, exclusing itself.
| |||||||||||
Retrieves a thread-specific non validating
DocumentBuilder . | |||||||||||
This returns a deep search of the raw text of a specified node.
| |||||||||||
Gets all the text nodes of an Element.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
This returns a org.w3c.dom.Node implementation that has better toString() attached to it. Its useful inside a debugger so you can easily see what content a node has. Each org.w3c.dom.Node that is linked to from this node will also get the better toString() methods applied to it.
You can call this function safely on already wrapped Node objects since it can detect if they have already been wrapped
node | the Node to make into a better one |
---|
This will copy the Node' s from srcNode into a new org.w3c.dom.DocumentFragment
srcNode | the source element to copy from |
---|---|
convertTagsToLowerCase | whether to copy the element tags to lower case |
IllegalArgumentException | if the srcNode is not a org.w3c.dom.Document or org.w3c.dom.Element |
---|
Returns the first BODY element of the Document or null if there isnt one
document | the Document to search |
---|
Returns the collapsed text of the specified Node. The collapsing of text text is done in the following way :
So if ^ represent spaces then the string "^^^^some^bold%^text^and^someother^text" will become "some bold text and someother text".
node | the Node to search |
---|
element | the element to start searching from |
---|---|
parentTagName | the tag name of the parent to retrieve |
This will return an "canonical" version of the HTML that makes up the given org.w3c.dom.Element, including itself.
HTML tags will be converted to lower case if they are not already. This is a suitabe default in JIRA even if the object model of browsers and HttpUnit use uppercase for tags. It matches the JSP code we use in lower case.
node | the Node in play |
---|
RuntimeException | if the parsing is unsuccessful |
---|
Returns the first HTML element of the Document or null if there isnt one
document | the Document to search |
---|
This will return an "canonical" version of the HTML that makes up the given org.w3c.dom.Node, exclusing itself.
HTML tags will be converted to lower case if they are not already.
node | the Node in play |
---|
RuntimeException | if the parsing is unsuccessful |
---|
Retrieves a thread-specific non validating DocumentBuilder
. We do this because they are expensive to build.
DocumentBuilder
serving the current thread.
This returns a deep search of the raw text of a specified node.
node | the org.w3c.dom.Node in question |
---|
Gets all the text nodes of an Element. Does a deep walk of the node tree.
element | the Element in play |
---|