Package org.wildfly.client.config
Class XMLLocation
java.lang.Object
org.wildfly.client.config.XMLLocation
- All Implemented Interfaces:
Comparable<XMLLocation>,Location
An XML location which is readable by humans and which understands XInclude.
- Author:
- David M. Lloyd
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionXMLLocation(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. -
Method Summary
Modifier and TypeMethodDescriptionintCompare for sort.booleanDetermine whether this object is equal to another.booleanequals(XMLLocation other) Determine whether this object is equal to another.intGet the absolute character offset of this event.intGet the column number where the corresponding event ends.Get the location that this location was included from.intGet the line number where the corresponding event ends.Get the public ID of the XML.Get the system ID of the XML.getUri()Get the file name.inthashCode()toString()Get the location as a string.static XMLLocationtoXMLLocation(URI uri, Location location) static XMLLocationtoXMLLocation(Location location) static XMLLocationtoXMLLocation(XMLLocation includedFrom, URI uri, Location location) static XMLLocationtoXMLLocation(XMLLocation includedFrom, Location location)
-
Field Details
-
UNKNOWN
An unknown location.
-
-
Constructor Details
-
XMLLocation
public XMLLocation(XMLLocation includedFrom, URI uri, int lineNumber, int columnNumber, int characterOffset, String publicId, String systemId) Construct a new instance.- Parameters:
includedFrom- the source location that this location was included fromuri- the source location (may benullif not known)lineNumber- the line number (may be-1if not known)columnNumber- the column number (may be-1if not known)characterOffset- the character offset (may be-1if not known)publicId- the XML public ID (may benull)systemId- the XML system ID (may benull)
-
XMLLocation
public XMLLocation(URI uri, int lineNumber, int columnNumber, int characterOffset, String publicId, String systemId) Construct a new instance.- Parameters:
uri- the source location (may benullif not known)lineNumber- the line number (may be-1if not known)columnNumber- the column number (may be-1if not known)characterOffset- the character offset (may be-1if not known)publicId- the XML public ID (may benull)systemId- the XML system ID (may benull)
-
XMLLocation
public XMLLocation(XMLLocation includedFrom, URI uri, int lineNumber, int columnNumber, int characterOffset) Construct a new instance.- Parameters:
includedFrom- the source location that this location was included fromuri- the source location (may benullif not known)lineNumber- the line number (may be-1if not known)columnNumber- the column number (may be-1if not known)characterOffset- the character offset (may be-1if not known)
-
XMLLocation
Construct a new instance.- Parameters:
uri- the source location (may benullif not known)lineNumber- the line number (may be-1if not known)columnNumber- the column number (may be-1if not known)characterOffset- the character offset (may be-1if not known)
-
XMLLocation
Construct a new instance.- Parameters:
uri- the file name (may benullif this location does not correspond to a file)
-
-
Method Details
-
getUri
Get the file name. May benullif this location does not correspond to a file.- Returns:
- the file name
-
getLineNumber
public int getLineNumber()Get the line number where the corresponding event ends. Returns -1 if not known.- Specified by:
getLineNumberin interfaceLocation- Returns:
- the line number where the corresponding event ends
-
getColumnNumber
public int getColumnNumber()Get the column number where the corresponding event ends. Returns -1 if not known.- Specified by:
getColumnNumberin interfaceLocation- Returns:
- the column number where the corresponding event ends
-
getCharacterOffset
public int getCharacterOffset()Get the absolute character offset of this event. Returns -1 if not known.- Specified by:
getCharacterOffsetin interfaceLocation- Returns:
- the absolute character offset of this event
-
getPublicId
Get the public ID of the XML. Returnsnullif not known.- Specified by:
getPublicIdin interfaceLocation- Returns:
- the public ID of the XML
-
getSystemId
Get the system ID of the XML. Returnsnullif not known.- Specified by:
getSystemIdin interfaceLocation- Returns:
- the system ID of the XML
-
getIncludedFrom
Get the location that this location was included from. Returnsnullif this was the root document.- Returns:
- the location that this location was included from, or
null
-
toXMLLocation
-
toXMLLocation
-
toXMLLocation
-
toXMLLocation
-
hashCode
public int hashCode() -
equals
Determine whether this object is equal to another. -
equals
Determine whether this object is equal to another.- Parameters:
other- the other object- Returns:
trueif they are equal,falseotherwise
-
toString
Get the location as a string. The string will be suitable for immediately prefixing an error message. -
compareTo
Compare for sort.- Specified by:
compareToin interfaceComparable<XMLLocation>- Parameters:
o- the other location- Returns:
- the sort result (-1, 0, or 1)
-