Class PartialFilePositioner

    • Field Detail

      • textDoc

        protected final TextDoc textDoc
      • systemId

        private final java.lang.String systemId
    • Constructor Detail

      • PartialFilePositioner

        public PartialFilePositioner​(java.lang.String fullFileText,
                                     java.lang.String systemId)
        Parameters:
        fullFileText - Full text of the XML file
    • Method Detail

      • startPositionOf

        public XmlPosition startPositionOf​(@Nullable org.w3c.dom.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