Interface XmlPositioner

    • Method Detail

      • startPositionOf

        XmlPosition startPositionOf​(@Nullable org.w3c.dom.Node node)
        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.
        Parameters:
        node - XML node
        Returns:
        A position
      • getLinesAround

        @Nullable ContextLines getLinesAround​(XmlPosition position,
                                              int numContextLines)
        Enrich the given message with the context of the position. Typically this adds the source lines of the source file around the error message.
        Parameters:
        position - Position of the error
        numContextLines - Number of lines to include before and after
        Returns:
        The full message
      • noPositioner

        static XmlPositioner noPositioner​(@Nullable java.lang.String systemId)
        A positioner that returns undefined positions.
        Parameters:
        systemId - Optional system id, if it is known (but not line/columns)
        Returns:
        A new positioner