Class ElementReference

java.lang.Object
io.goobi.viewer.api.rest.model.ner.ElementReference

public class ElementReference extends Object
REST API model referencing a single named-entity element within a page of a digitized document. Holds the element's XML ID, bounding-box coordinates, text content, optional URI, and the page order number on which it appears.
  • Constructor Details

    • ElementReference

      public ElementReference()
      Creates a new ElementReference instance.
    • ElementReference

      public ElementReference(String id, Rectangle coordinates, String content, String uri)
      Creates a new ElementReference instance.
      Parameters:
      id - XML element ID of the referenced NER token
      coordinates - bounding box of the element on the page
      content - text content of the NER element
      uri - Value of the URI attribute
  • Method Details

    • getId

      public String getId()
      Getter for the field id.
      Returns:
      the identifier of this element reference
    • getCoordinates

      public String getCoordinates()
      Getter for the field coordinates.
      Returns:
      the bounding box coordinates of this element as a string
    • getCoordinatesAsRect

      public Rectangle getCoordinatesAsRect()
      getCoordinatesAsRect.
      Returns:
      the bounding box of the element on the page as a Rectangle
    • setCoordinates

      public void setCoordinates(Rectangle coordinates)
      Setter for the field coordinates.
      Parameters:
      coordinates - bounding box of the element on the page
    • getContent

      public String getContent()
      Getter for the field content.
      Returns:
      the text content of this NER element
    • setContent

      public void setContent(String content)
      Setter for the field content.
      Parameters:
      content - text content of the NER element
    • getUri

      public String getUri()
    • setUri

      public void setUri(String uri)
    • getPage

      public int getPage()
      Getter for the field page.
      Returns:
      the 1-based page order number of the referenced element
    • setPage

      public void setPage(int pageNo)
      Setter for the field page.
      Parameters:
      pageNo - 1-based page order number of the referenced element