Class PartialFilePositioner
- java.lang.Object
-
- com.github.oowekyala.ooxml.messages.PartialFilePositioner
-
- All Implemented Interfaces:
XmlPositioner
- Direct Known Subclasses:
FullFilePositioner
class PartialFilePositioner extends java.lang.Object implements XmlPositioner
-
-
Field Summary
Fields Modifier and Type Field Description private static intNUM_LINES_AROUNDprivate java.lang.StringsystemIdprotected TextDoctextDoc
-
Constructor Summary
Constructors Constructor Description PartialFilePositioner(java.lang.String fullFileText, java.lang.String systemId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable ContextLinesgetLinesAround(XmlPosition position, int numContextLines)Enrich the given message with the context of the position.XmlPositionstartPositionOf(@Nullable org.w3c.dom.Node node)Returns an object describing the position in the file of the given XML node.
-
-
-
Field Detail
-
NUM_LINES_AROUND
private static final int NUM_LINES_AROUND
- See Also:
- Constant Field Values
-
textDoc
protected final TextDoc textDoc
-
systemId
private final java.lang.String systemId
-
-
Method Detail
-
startPositionOf
public XmlPosition startPositionOf(@Nullable org.w3c.dom.Node node)
Description copied from interface:XmlPositionerReturns 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:
startPositionOfin interfaceXmlPositioner- Parameters:
node- XML node- Returns:
- A position
-
getLinesAround
public @Nullable ContextLines getLinesAround(XmlPosition position, int numContextLines)
Description copied from interface:XmlPositionerEnrich 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:
getLinesAroundin interfaceXmlPositioner- Parameters:
position- Position of the errornumContextLines- Number of lines to include before and after- Returns:
- The full message
-
-