Stay organized with collections
Save and categorize content based on your preferences.
DOMLocator
public
interface
DOMLocator
DOMLocator
is an interface that describes a location (e.g.
where an error occurred).
See also the Document Object Model (DOM) Level 3 Core Specification.
Summary
Public methods |
abstract
int
|
getByteOffset()
The byte offset into the input source this locator is pointing to or
-1 if there is no byte offset available.
|
abstract
int
|
getColumnNumber()
The column number this locator is pointing to, or -1 if
there is no column number available.
|
abstract
int
|
getLineNumber()
The line number this locator is pointing to, or -1 if
there is no column number available.
|
abstract
Node
|
getRelatedNode()
The node this locator is pointing to, or null if no node
is available.
|
abstract
String
|
getUri()
The URI this locator is pointing to, or null if no URI is
available.
|
abstract
int
|
getUtf16Offset()
The UTF-16, as defined in [Unicode] and Amendment 1 of [ISO/IEC 10646], offset into the input source this locator is pointing to or
-1 if there is no UTF-16 offset available.
|
Public methods
getByteOffset
public abstract int getByteOffset ()
The byte offset into the input source this locator is pointing to or
-1
if there is no byte offset available.
getColumnNumber
public abstract int getColumnNumber ()
The column number this locator is pointing to, or -1
if
there is no column number available.
getLineNumber
public abstract int getLineNumber ()
The line number this locator is pointing to, or -1
if
there is no column number available.
public abstract Node getRelatedNode ()
The node this locator is pointing to, or null
if no node
is available.
getUri
public abstract String getUri ()
The URI this locator is pointing to, or null
if no URI is
available.
getUtf16Offset
public abstract int getUtf16Offset ()
The UTF-16, as defined in [Unicode] and Amendment 1 of [ISO/IEC 10646], offset into the input source this locator is pointing to or
-1
if there is no UTF-16 offset available.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# DOMLocator\n\nAdded in [API level 8](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nDOMLocator\n==========\n\n\n`\npublic\n\n\ninterface\nDOMLocator\n`\n\n\n`\n\n\n`\n\n|------------------------|\n| org.w3c.dom.DOMLocator |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\n`DOMLocator` is an interface that describes a location (e.g.\nwhere an error occurred).\n\nSee also the [Document Object Model (DOM) Level 3 Core Specification](http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407).\n\nSummary\n-------\n\n| ### Public methods ||\n|---------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract int` | ` `[getByteOffset](/reference/org/w3c/dom/DOMLocator#getByteOffset())`() ` The byte offset into the input source this locator is pointing to or `-1` if there is no byte offset available. |\n| ` abstract int` | ` `[getColumnNumber](/reference/org/w3c/dom/DOMLocator#getColumnNumber())`() ` The column number this locator is pointing to, or `-1` if there is no column number available. |\n| ` abstract int` | ` `[getLineNumber](/reference/org/w3c/dom/DOMLocator#getLineNumber())`() ` The line number this locator is pointing to, or `-1` if there is no column number available. |\n| ` abstract `[Node](/reference/org/w3c/dom/Node) | ` `[getRelatedNode](/reference/org/w3c/dom/DOMLocator#getRelatedNode())`() ` The node this locator is pointing to, or `null` if no node is available. |\n| ` abstract `[String](/reference/java/lang/String) | ` `[getUri](/reference/org/w3c/dom/DOMLocator#getUri())`() ` The URI this locator is pointing to, or `null` if no URI is available. |\n| ` abstract int` | ` `[getUtf16Offset](/reference/org/w3c/dom/DOMLocator#getUtf16Offset())`() ` The UTF-16, as defined in \\[Unicode\\] and Amendment 1 of \\[ISO/IEC 10646\\], offset into the input source this locator is pointing to or `-1` if there is no UTF-16 offset available. |\n\nPublic methods\n--------------\n\n### getByteOffset\n\nAdded in [API level 8](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract int getByteOffset ()\n```\n\nThe byte offset into the input source this locator is pointing to or\n`-1` if there is no byte offset available.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------|--------|\n| `int` | \u003cbr /\u003e |\n\n### getColumnNumber\n\nAdded in [API level 8](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract int getColumnNumber ()\n```\n\nThe column number this locator is pointing to, or `-1` if\nthere is no column number available.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------|--------|\n| `int` | \u003cbr /\u003e |\n\n### getLineNumber\n\nAdded in [API level 8](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract int getLineNumber ()\n```\n\nThe line number this locator is pointing to, or `-1` if\nthere is no column number available.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------|--------|\n| `int` | \u003cbr /\u003e |\n\n### getRelatedNode\n\nAdded in [API level 8](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract Node getRelatedNode ()\n```\n\nThe node this locator is pointing to, or `null` if no node\nis available.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------------------------------------|--------|\n| [Node](/reference/org/w3c/dom/Node) | \u003cbr /\u003e |\n\n### getUri\n\nAdded in [API level 8](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract String getUri ()\n```\n\nThe URI this locator is pointing to, or `null` if no URI is\navailable.\n\n\u003cbr /\u003e\n\n| Returns ||\n|---------------------------------------|--------|\n| [String](/reference/java/lang/String) | \u003cbr /\u003e |\n\n### getUtf16Offset\n\nAdded in [API level 8](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract int getUtf16Offset ()\n```\n\nThe UTF-16, as defined in \\[Unicode\\] and Amendment 1 of \\[ISO/IEC 10646\\], offset into the input source this locator is pointing to or\n`-1` if there is no UTF-16 offset available.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------|--------|\n| `int` | \u003cbr /\u003e |"]]