Package ro.sync.ecss.extensions.api.node
Class AuthorNodeUtil
java.lang.Object
ro.sync.ecss.extensions.api.node.AuthorNodeUtil
Utility functions for working with AuthorNodes.
- Since:
- 15.2
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intgetChildIndex(int offset, List<AuthorNode> children) Looks for the child that contains the given offset.static AuthorElementgetFirstChildElement(AuthorParentNode parentNode) Return the first child element.static AuthorNodegetFirstLeaf(AuthorDocumentFragment fragment) Finds the first leaf node in the document fragment.static List<AuthorNode>minimizeAuthorCollection(Collection<? extends AuthorNode> collection) Remove from the collection of nodes any descendants so the only nodes that are kept are disjunct.
-
Field Details
-
ATTRIBUTE_VALUE_MARKER
Marker used to find a certain element- See Also:
-
-
Constructor Details
-
AuthorNodeUtil
public AuthorNodeUtil()
-
-
Method Details
-
minimizeAuthorCollection
public static List<AuthorNode> minimizeAuthorCollection(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
Finds the first leaf node in the document fragment.- Parameters:
fragment- The document fragment.- Returns:
- The first leaf.
-
getFirstChildElement
Return the first child element.- Parameters:
parentNode- The parent element.- Returns:
- the first child element.
-
getChildIndex
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.
-