Class PartialFilePositioner

java.lang.Object
com.github.oowekyala.ooxml.messages.PartialFilePositioner
All Implemented Interfaces:
XmlPositioner
Direct Known Subclasses:
FullFilePositioner

class PartialFilePositioner extends Object implements XmlPositioner
  • Field Details

    • NUM_LINES_AROUND

      private static final int NUM_LINES_AROUND
      See Also:
    • textDoc

      protected final TextDoc textDoc
    • systemId

      private final String systemId
  • Constructor Details

    • PartialFilePositioner

      public PartialFilePositioner(String fullFileText, String systemId)
      Parameters:
      fullFileText - Full text of the XML file
  • Method Details

    • startPositionOf

      public XmlPosition startPositionOf(@Nullable Node node)
      Description copied from interface: XmlPositioner
      Returns an object describing the position in the file of the given XML node. If no position is available, or if the parameter is null, returns an undefined position.
      Specified by:
      startPositionOf in interface XmlPositioner
      Parameters:
      node - XML node
      Returns:
      A position
    • getLinesAround

      public @Nullable ContextLines getLinesAround(XmlPosition position, int numContextLines)
      Description copied from interface: XmlPositioner
      Enrich the given message with the context of the position. Typically this adds the source lines of the source file around the error message.
      Specified by:
      getLinesAround in interface XmlPositioner
      Parameters:
      position - Position of the error
      numContextLines - Number of lines to include before and after
      Returns:
      The full message