Package ro.sync.ecss.extensions.api.node
Class AuthorNodeUtil
- java.lang.Object
-
- ro.sync.ecss.extensions.api.node.AuthorNodeUtil
-
@API(type=NOT_EXTENDABLE, src=PUBLIC) public class AuthorNodeUtil extends java.lang.Object
Utility functions for working with AuthorNodes.- Since:
- 15.2
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ATTRIBUTE_VALUE_MARKER
Marker used to find a certain element
-
Constructor Summary
Constructors Constructor Description AuthorNodeUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
getChildIndex(int offset, java.util.List<AuthorNode> children)
Looks for the child that contains the given offset.static AuthorElement
getFirstChildElement(AuthorParentNode parentNode)
Return the first child element.static AuthorNode
getFirstLeaf(AuthorDocumentFragment fragment)
Finds the first leaf node in the document fragment.static java.util.List<AuthorNode>
minimizeAuthorCollection(java.util.Collection<? extends AuthorNode> collection)
Remove from the collection of nodes any descendants so the only nodes that are kept are disjunct.
-
-
-
Field Detail
-
ATTRIBUTE_VALUE_MARKER
public static final java.lang.String ATTRIBUTE_VALUE_MARKER
Marker used to find a certain element- See Also:
- Constant Field Values
-
-
Method Detail
-
minimizeAuthorCollection
public static java.util.List<AuthorNode> minimizeAuthorCollection(java.util.Collection<? extends AuthorNode> collection)
Remove from the collection of nodes any descendants so the only nodes that are kept are disjunct.- Parameters:
collection
- A collection of nodes.- Returns:
- A list of disjunct nodes.
-
getFirstLeaf
public static AuthorNode getFirstLeaf(AuthorDocumentFragment fragment)
Finds the first leaf node in the document fragment.- Parameters:
fragment
- The document fragment.- Returns:
- The first leaf.
-
getFirstChildElement
public static AuthorElement getFirstChildElement(AuthorParentNode parentNode)
Return the first child element.- Parameters:
parentNode
- The parent element.- Returns:
- the first child element.
-
getChildIndex
public static int getChildIndex(int offset, java.util.List<AuthorNode> children)
Looks for the child that contains the given offset.- Parameters:
offset
- Searched offset.children
- The list of children.- Returns:
- The index of the child in the list of children or -1 if not found.
-
-