@Beta
public interface IDomParser
Modifier and Type | Method and Description |
---|---|
Location.Handle |
createLocationHandle(XmlContext context,
org.w3c.dom.Node node)
Creates a light-weight handle to a location for the given node.
|
void |
dispose(XmlContext context,
org.w3c.dom.Document document)
Dispose any data structures held for the given context.
|
Location |
getLocation(XmlContext context,
org.w3c.dom.Node node)
Returns a
Location for the given DOM node |
Location |
getLocation(XmlContext context,
org.w3c.dom.Node node,
int start,
int end)
Returns a
Location for the given DOM node. |
org.w3c.dom.Document |
parseXml(XmlContext context)
Parse the file pointed to by the given context and return as a Document
|
@Nullable org.w3c.dom.Document parseXml(@NonNull XmlContext context)
context
- the context pointing to the file to be parsed, typically
via Context.getContents()
but the file handle (
Context.file
can also be used to map to an existing
editor buffer in the surrounding tool, etc)@NonNull Location getLocation(@NonNull XmlContext context, @NonNull org.w3c.dom.Node node)
Location
for the given DOM nodecontext
- information about the file being parsednode
- the node to create a location for@NonNull Location getLocation(@NonNull XmlContext context, @NonNull org.w3c.dom.Node node, int start, int end)
Location
for the given DOM node. Like
getLocation(XmlContext, Node)
, but allows a position range that
is a subset of the node range.context
- information about the file being parsednode
- the node to create a location forstart
- the starting position within the node, inclusiveend
- the ending position within the node, exclusive@NonNull Location.Handle createLocationHandle(@NonNull XmlContext context, @NonNull org.w3c.dom.Node node)
Location.Handle.resolve()
.context
- the context providing the nodenode
- the node (element or attribute) to create a location handle
forvoid dispose(@NonNull XmlContext context, @NonNull org.w3c.dom.Document document)
context
- information about the file previously parseddocument
- the document that was parsed and is now being disposed