|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
@Beta public interface IDomParser
A wrapper for an XML parser. This allows tools integrating lint to map directly to builtin services, such as already-parsed data structures in XML editors.
NOTE: This is not a public or final API; if you rely on this be prepared to adjust your code for the next tools release.
| Method Summary | |
|---|---|
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. |
int |
getNodeEndOffset(XmlContext context,
org.w3c.dom.Node node)
Returns the end offset of the given node, or -1 if not known |
int |
getNodeStartOffset(XmlContext context,
org.w3c.dom.Node node)
Returns the start offset of the given node, or -1 if not known |
org.w3c.dom.Document |
parseXml(XmlContext context)
Parse the file pointed to by the given context and return as a Document |
| Method Detail |
|---|
@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 node
context - 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
for
void 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
int getNodeStartOffset(@NonNull
XmlContext context,
@NonNull
org.w3c.dom.Node node)
context - the context providing the nodenode - the node (element or attribute) to create a location handle
for
int getNodeEndOffset(@NonNull
XmlContext context,
@NonNull
org.w3c.dom.Node node)
context - the context providing the nodenode - the node (element or attribute) to create a location handle
for
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||