Class AuthorNodeUtil

java.lang.Object
ro.sync.ecss.extensions.api.node.AuthorNodeUtil

@API(type=NOT_EXTENDABLE, src=PUBLIC) public class AuthorNodeUtil extends Object
Utility functions for working with AuthorNodes.
Since:
15.2
  • Field Details

    • ATTRIBUTE_VALUE_MARKER

      public static final String 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

      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, 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.