public final class XMLLocation extends Object implements Location, Comparable<XMLLocation>
| Modifier and Type | Field and Description |
|---|---|
static XMLLocation |
UNKNOWN
An unknown location.
|
| Constructor and Description |
|---|
XMLLocation(URI uri)
Construct a new instance.
|
XMLLocation(URI uri,
int lineNumber,
int columnNumber,
int characterOffset)
Construct a new instance.
|
XMLLocation(URI uri,
int lineNumber,
int columnNumber,
int characterOffset,
String publicId,
String systemId)
Construct a new instance.
|
XMLLocation(XMLLocation includedFrom,
URI uri,
int lineNumber,
int columnNumber,
int characterOffset)
Construct a new instance.
|
XMLLocation(XMLLocation includedFrom,
URI uri,
int lineNumber,
int columnNumber,
int characterOffset,
String publicId,
String systemId)
Construct a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(XMLLocation o)
Compare for sort.
|
boolean |
equals(Object other)
Determine whether this object is equal to another.
|
boolean |
equals(XMLLocation other)
Determine whether this object is equal to another.
|
int |
getCharacterOffset()
Get the absolute character offset of this event.
|
int |
getColumnNumber()
Get the column number where the corresponding event ends.
|
XMLLocation |
getIncludedFrom()
Get the location that this location was included from.
|
int |
getLineNumber()
Get the line number where the corresponding event ends.
|
String |
getPublicId()
Get the public ID of the XML.
|
String |
getSystemId()
Get the system ID of the XML.
|
URI |
getUri()
Get the file name.
|
int |
hashCode() |
String |
toString()
Get the location as a string.
|
static XMLLocation |
toXMLLocation(Location location) |
static XMLLocation |
toXMLLocation(URI uri,
Location location) |
static XMLLocation |
toXMLLocation(XMLLocation includedFrom,
Location location) |
static XMLLocation |
toXMLLocation(XMLLocation includedFrom,
URI uri,
Location location) |
public static final XMLLocation UNKNOWN
public XMLLocation(XMLLocation includedFrom, URI uri, int lineNumber, int columnNumber, int characterOffset, String publicId, String systemId)
includedFrom - the source location that this location was included fromuri - the source location (may be null if not known)lineNumber - the line number (may be -1 if not known)columnNumber - the column number (may be -1 if not known)characterOffset - the character offset (may be -1 if not known)publicId - the XML public ID (may be null)systemId - the XML system ID (may be null)public XMLLocation(URI uri, int lineNumber, int columnNumber, int characterOffset, String publicId, String systemId)
uri - the source location (may be null if not known)lineNumber - the line number (may be -1 if not known)columnNumber - the column number (may be -1 if not known)characterOffset - the character offset (may be -1 if not known)publicId - the XML public ID (may be null)systemId - the XML system ID (may be null)public XMLLocation(XMLLocation includedFrom, URI uri, int lineNumber, int columnNumber, int characterOffset)
includedFrom - the source location that this location was included fromuri - the source location (may be null if not known)lineNumber - the line number (may be -1 if not known)columnNumber - the column number (may be -1 if not known)characterOffset - the character offset (may be -1 if not known)public XMLLocation(URI uri, int lineNumber, int columnNumber, int characterOffset)
uri - the source location (may be null if not known)lineNumber - the line number (may be -1 if not known)columnNumber - the column number (may be -1 if not known)characterOffset - the character offset (may be -1 if not known)public XMLLocation(URI uri)
uri - the file name (may be null if this location does not correspond to a file)public URI getUri()
null if this location does not correspond to a file.public int getLineNumber()
getLineNumber in interface Locationpublic int getColumnNumber()
getColumnNumber in interface Locationpublic int getCharacterOffset()
getCharacterOffset in interface Locationpublic String getPublicId()
null if not known.getPublicId in interface Locationpublic String getSystemId()
null if not known.getSystemId in interface Locationpublic XMLLocation getIncludedFrom()
null if this was the root document.nullpublic static XMLLocation toXMLLocation(Location location)
public static XMLLocation toXMLLocation(URI uri, Location location)
public static XMLLocation toXMLLocation(XMLLocation includedFrom, Location location)
public static XMLLocation toXMLLocation(XMLLocation includedFrom, URI uri, Location location)
public boolean equals(Object other)
public boolean equals(XMLLocation other)
other - the other objecttrue if they are equal, false otherwisepublic String toString()
public int compareTo(XMLLocation o)
compareTo in interface Comparable<XMLLocation>o - the other locationCopyright © 2017 JBoss by Red Hat. All rights reserved.