Stay organized with collections
Save and categorize content based on your preferences.
SourceLocator
public
interface
SourceLocator
javax.xml.transform.SourceLocator
|
Known indirect subclasses
DOMLocator |
Indicates the position of a node in a source DOM, intended
primarily for error reporting.
|
|
This interface is primarily for the purposes of reporting where
an error occurred in the XML source or transformation instructions.
Summary
Public methods |
abstract
int
|
getColumnNumber()
Return the character position where the current document event ends.
|
abstract
int
|
getLineNumber()
Return the line number where the current document event ends.
|
abstract
String
|
getPublicId()
Return the public identifier for the current document event.
|
abstract
String
|
getSystemId()
Return the system identifier for the current document event.
|
Public methods
getColumnNumber
public abstract int getColumnNumber ()
Return the character position where the current document event ends.
Warning: The return value from the method
is intended only as an approximation for the sake of error
reporting; it is not intended to provide sufficient information
to edit the character content of the original XML document.
The return value is an approximation of the column number
in the document entity or external parsed entity where the
markup that triggered the event appears.
Returns |
int |
The column number, or -1 if none is available. |
getLineNumber
public abstract int getLineNumber ()
Return the line number where the current document event ends.
Warning: The return value from the method
is intended only as an approximation for the sake of error
reporting; it is not intended to provide sufficient information
to edit the character content of the original XML document.
The return value is an approximation of the line number
in the document entity or external parsed entity where the
markup that triggered the event appears.
Returns |
int |
The line number, or -1 if none is available. |
getPublicId
public abstract String getPublicId ()
Return the public identifier for the current document event.
The return value is the public identifier of the document
entity or of the external parsed entity in which the markup that
triggered the event appears.
Returns |
String |
A string containing the public identifier, or
null if none is available. |
getSystemId
public abstract String getSystemId ()
Return the system identifier for the current document event.
The return value is the system identifier of the document
entity or of the external parsed entity in which the markup that
triggered the event appears.
If the system identifier is a URL, the parser must resolve it
fully before passing it to the application.
Returns |
String |
A string containing the system identifier, or null
if none is 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,["# SourceLocator\n\nAdded in [API level 8](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nSummary: [Methods](#pubmethods) \n\nSourceLocator\n=============\n\n\n`\npublic\n\n\ninterface\nSourceLocator\n`\n\n\n`\n\n\n`\n\n|-----------------------------------|\n| javax.xml.transform.SourceLocator |\n\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known indirect subclasses [DOMLocator](/reference/javax/xml/transform/dom/DOMLocator) |-------------------------------------------------------------|-------------------------------------------------------------------------------------------| | [DOMLocator](/reference/javax/xml/transform/dom/DOMLocator) | Indicates the position of a node in a source DOM, intended primarily for error reporting. | |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nThis interface is primarily for the purposes of reporting where\nan error occurred in the XML source or transformation instructions.\n\nSummary\n-------\n\n| ### Public methods ||\n|---------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract int` | ` `[getColumnNumber](/reference/javax/xml/transform/SourceLocator#getColumnNumber())`() ` Return the character position where the current document event ends. |\n| ` abstract int` | ` `[getLineNumber](/reference/javax/xml/transform/SourceLocator#getLineNumber())`() ` Return the line number where the current document event ends. |\n| ` abstract `[String](/reference/java/lang/String) | ` `[getPublicId](/reference/javax/xml/transform/SourceLocator#getPublicId())`() ` Return the public identifier for the current document event. |\n| ` abstract `[String](/reference/java/lang/String) | ` `[getSystemId](/reference/javax/xml/transform/SourceLocator#getSystemId())`() ` Return the system identifier for the current document event. |\n\nPublic methods\n--------------\n\n### getColumnNumber\n\nAdded in [API level 8](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract int getColumnNumber ()\n```\n\nReturn the character position where the current document event ends.\n\n**Warning:** The return value from the method\nis intended only as an approximation for the sake of error\nreporting; it is not intended to provide sufficient information\nto edit the character content of the original XML document.\n\nThe return value is an approximation of the column number\nin the document entity or external parsed entity where the\nmarkup that triggered the event appears.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------|-------------------------------------------------------|\n| `int` | The column number, or -1 if none is available. \u003cbr /\u003e |\n\n**See also:**\n\n- [getLineNumber()](/reference/javax/xml/transform/SourceLocator#getLineNumber()) \n\n### getLineNumber\n\nAdded in [API level 8](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract int getLineNumber ()\n```\n\nReturn the line number where the current document event ends.\n\n**Warning:** The return value from the method\nis intended only as an approximation for the sake of error\nreporting; it is not intended to provide sufficient information\nto edit the character content of the original XML document.\n\nThe return value is an approximation of the line number\nin the document entity or external parsed entity where the\nmarkup that triggered the event appears.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------|-----------------------------------------------------|\n| `int` | The line number, or -1 if none is available. \u003cbr /\u003e |\n\n**See also:**\n\n- [getColumnNumber()](/reference/javax/xml/transform/SourceLocator#getColumnNumber()) \n\n### getPublicId\n\nAdded in [API level 8](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract String getPublicId ()\n```\n\nReturn the public identifier for the current document event.\n\nThe return value is the public identifier of the document\nentity or of the external parsed entity in which the markup that\ntriggered the event appears.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|---------------------------------------|---------------------------------------------------------------------------------|\n| [String](/reference/java/lang/String) | A string containing the public identifier, or null if none is available. \u003cbr /\u003e |\n\n**See also:**\n\n- [getSystemId()](/reference/javax/xml/transform/SourceLocator#getSystemId()) \n\n### getSystemId\n\nAdded in [API level 8](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract String getSystemId ()\n```\n\nReturn the system identifier for the current document event.\n\nThe return value is the system identifier of the document\nentity or of the external parsed entity in which the markup that\ntriggered the event appears.\n\nIf the system identifier is a URL, the parser must resolve it\nfully before passing it to the application.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|---------------------------------------|---------------------------------------------------------------------------------|\n| [String](/reference/java/lang/String) | A string containing the system identifier, or null if none is available. \u003cbr /\u003e |\n\n**See also:**\n\n- [getPublicId()](/reference/javax/xml/transform/SourceLocator#getPublicId())"]]