SourceLocator
Stay organized with collections
Save and categorize content based on your preferences.
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.
Public Method Summary
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
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
- The column number, or -1 if none is available.
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
- The line number, or -1 if none is available.
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
- A string containing the public identifier, or
null if none is available.
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
- A string containing the system identifier, or null
if none is available.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-07-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 2024-07-10 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eSourceLocator\u003c/code\u003e interface helps pinpoint errors in XML source or transformation instructions.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods to get the location of an error, such as line and column numbers.\u003c/p\u003e\n"],["\u003cp\u003eIt also provides methods to access public and system identifiers for the document event.\u003c/p\u003e\n"],["\u003cp\u003eThe primary purpose is error reporting, and the location information is an approximation, not for precise editing.\u003c/p\u003e\n"]]],[],null,["# SourceLocator\n\npublic interface **SourceLocator** \n\n|---|---|---|\n| Known Indirect Subclasses [DOMLocator](../../../../reference/javax/xml/transform/dom/DOMLocator.html) |-----------------------------------------------------------------------------|-------------------------------------------------------------------------------------------| | [DOMLocator](../../../../reference/javax/xml/transform/dom/DOMLocator.html) | Indicates the position of a node in a source DOM, intended primarily for error reporting. | |||\n\nThis interface is primarily for the purposes of reporting where\nan error occurred in the XML source or transformation instructions. \n\n### Public Method Summary\n\n|----------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract int | [getColumnNumber](../../../../reference/javax/xml/transform/SourceLocator.html#getColumnNumber())() Return the character position where the current document event ends. |\n| abstract int | [getLineNumber](../../../../reference/javax/xml/transform/SourceLocator.html#getLineNumber())() Return the line number where the current document event ends. |\n| abstract [String](../../../../reference/java/lang/String.html) | [getPublicId](../../../../reference/javax/xml/transform/SourceLocator.html#getPublicId())() Return the public identifier for the current document event. |\n| abstract [String](../../../../reference/java/lang/String.html) | [getSystemId](../../../../reference/javax/xml/transform/SourceLocator.html#getSystemId())() Return the system identifier for the current document event. |\n\nPublic Methods\n--------------\n\n#### public abstract int\n**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##### Returns\n\n- The column number, or -1 if none is available. \n\n##### See Also\n\n- [getLineNumber()](../../../../reference/javax/xml/transform/SourceLocator.html#getLineNumber()) \n\n#### public abstract int\n**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##### Returns\n\n- The line number, or -1 if none is available. \n\n##### See Also\n\n- [getColumnNumber()](../../../../reference/javax/xml/transform/SourceLocator.html#getColumnNumber()) \n\n#### public abstract [String](../../../../reference/java/lang/String.html)\n**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##### Returns\n\n- A string containing the public identifier, or null if none is available. \n\n##### See Also\n\n- [getSystemId()](../../../../reference/javax/xml/transform/SourceLocator.html#getSystemId()) \n\n#### public abstract [String](../../../../reference/java/lang/String.html)\n**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##### Returns\n\n- A string containing the system identifier, or null if none is available. \n\n##### See Also\n\n- [getPublicId()](../../../../reference/javax/xml/transform/SourceLocator.html#getPublicId())"]]