Top Description Fields Constructors Methods
org.wildfly.client.config

public final Class XMLLocation

extends Object
implements Location, Comparable<XMLLocation>
Class Inheritance
All Implemented Interfaces
java.lang.Comparable, javax.xml.stream.Location
Static Imports
java.lang.Integer.signum

An XML location which is readable by humans and which understands XInclude.
Author
David M. Lloyd

Field Summary

Modifier and TypeField and Description
private final int
private final int
private int
private final XMLLocation
private final int
private final String
private final String
public static final XMLLocation
UNKNOWN

An unknown location.

private final URI

Constructor Summary

AccessConstructor and Description
public
XMLLocation(final XMLLocation
the source location that this location was included from
includedFrom
,
final URI
the source location (may be null if not known)
uri
,
final int
the line number (may be -1 if not known)
lineNumber
,
final int
the column number (may be -1 if not known)
columnNumber
,
final int
the character offset (may be -1 if not known)
characterOffset
,
final String
the XML public ID (may be null)
publicId
,
final String
the XML system ID (may be null)
systemId
)

Construct a new instance.

public
XMLLocation(final URI
the source location (may be null if not known)
uri
,
final int
the line number (may be -1 if not known)
lineNumber
,
final int
the column number (may be -1 if not known)
columnNumber
,
final int
the character offset (may be -1 if not known)
characterOffset
,
final String
the XML public ID (may be null)
publicId
,
final String
the XML system ID (may be null)
systemId
)

Construct a new instance.

public
XMLLocation(final XMLLocation
the source location that this location was included from
includedFrom
,
final URI
the source location (may be null if not known)
uri
,
final int
the line number (may be -1 if not known)
lineNumber
,
final int
the column number (may be -1 if not known)
columnNumber
,
final int
the character offset (may be -1 if not known)
characterOffset
)

Construct a new instance.

public
XMLLocation(final URI
the source location (may be null if not known)
uri
,
final int
the line number (may be -1 if not known)
lineNumber
,
final int
the column number (may be -1 if not known)
columnNumber
,
final int
the character offset (may be -1 if not known)
characterOffset
)

Construct a new instance.

public
XMLLocation(final URI
the file name (may be null if this location does not correspond to a file)
uri
)

Construct a new instance.

pack-priv
XMLLocation(final XMLLocation includedFrom, final URI
the file name (may be null if this location does not correspond to a file)
uri
,
final Location
the location to copy the remainder of the information from
original
)

Construct a new instance.

pack-priv
XMLLocation(final URI
the file name (may be null if this location does not correspond to a file)
uri
,
final Location
the location to copy the remainder of the information from
original
)

Construct a new instance.

pack-priv
XMLLocation(final Location
the location to copy the remainder of the information from
original
)

Construct a new instance.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the sort result (-1, 0, or 1)
compareTo
(final XMLLocation
the other location
o
)

Implements java.lang.Comparable.compareTo.

Compare for sort.
private int
public boolean

Returns:

true if they are equal, false otherwise
equals
(Object
the other object
other
)

Overrides java.lang.Object.equals.

Determine whether this object is equal to another.
private static boolean
public boolean

Returns:

true if they are equal, false otherwise
equals
(XMLLocation
the other object
other
)

Determine whether this object is equal to another.

public int

Returns:

the absolute character offset of this event
getCharacterOffset
()

Implements javax.xml.stream.Location.getCharacterOffset.

Get the absolute character offset of this event.
public int

Returns:

the column number where the corresponding event ends
getColumnNumber
()

Implements javax.xml.stream.Location.getColumnNumber.

Get the column number where the corresponding event ends.
public XMLLocation

Returns:

the location that this location was included from, or null
getIncludedFrom
()

Get the location that this location was included from.

public int

Returns:

the line number where the corresponding event ends
getLineNumber
()

Implements javax.xml.stream.Location.getLineNumber.

Get the line number where the corresponding event ends.
public String

Returns:

the public ID of the XML
getPublicId
()

Implements javax.xml.stream.Location.getPublicId.

Get the public ID of the XML.
public String

Returns:

the system ID of the XML
getSystemId
()

Implements javax.xml.stream.Location.getSystemId.

Get the system ID of the XML.
public URI

Returns:

the file name
getUri
()

Get the file name.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the object.
public String

Returns:

the location as a string
toString
()

Overrides java.lang.Object.toString.

Get the location as a string.
private void
public static XMLLocation
toXMLLocation(final Location location)

public static XMLLocation
toXMLLocation(final URI uri, final Location location)

public static XMLLocation
toXMLLocation(final XMLLocation includedFrom, final Location location)

public static XMLLocation
toXMLLocation(final XMLLocation includedFrom, final URI uri, final Location location)

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

characterOffsetback to summary
private final int characterOffset
columnNumberback to summary
private final int columnNumber
hashCodeback to summary
private int hashCode
includedFromback to summary
private final XMLLocation includedFrom
lineNumberback to summary
private final int lineNumber
publicIdback to summary
private final String publicId
systemIdback to summary
private final String systemId
UNKNOWNback to summary
public static final XMLLocation UNKNOWN

An unknown location.

uriback to summary
private final URI uri

Constructor Detail

XMLLocationback to summary
public XMLLocation(final XMLLocation includedFrom, final URI uri, final int lineNumber, final int columnNumber, final int characterOffset, final String publicId, final String systemId)

Construct a new instance.

Parameters
includedFrom:XMLLocation

the source location that this location was included from

uri:URI

the source location (may be null if not known)

lineNumber:int

the line number (may be -1 if not known)

columnNumber:int

the column number (may be -1 if not known)

characterOffset:int

the character offset (may be -1 if not known)

publicId:String

the XML public ID (may be null)

systemId:String

the XML system ID (may be null)

XMLLocationback to summary
public XMLLocation(final URI uri, final int lineNumber, final int columnNumber, final int characterOffset, final String publicId, final String systemId)

Construct a new instance.

Parameters
uri:URI

the source location (may be null if not known)

lineNumber:int

the line number (may be -1 if not known)

columnNumber:int

the column number (may be -1 if not known)

characterOffset:int

the character offset (may be -1 if not known)

publicId:String

the XML public ID (may be null)

systemId:String

the XML system ID (may be null)

XMLLocationback to summary
public XMLLocation(final XMLLocation includedFrom, final URI uri, final int lineNumber, final int columnNumber, final int characterOffset)

Construct a new instance.

Parameters
includedFrom:XMLLocation

the source location that this location was included from

uri:URI

the source location (may be null if not known)

lineNumber:int

the line number (may be -1 if not known)

columnNumber:int

the column number (may be -1 if not known)

characterOffset:int

the character offset (may be -1 if not known)

XMLLocationback to summary
public XMLLocation(final URI uri, final int lineNumber, final int columnNumber, final int characterOffset)

Construct a new instance.

Parameters
uri:URI

the source location (may be null if not known)

lineNumber:int

the line number (may be -1 if not known)

columnNumber:int

the column number (may be -1 if not known)

characterOffset:int

the character offset (may be -1 if not known)

XMLLocationback to summary
public XMLLocation(final URI uri)

Construct a new instance.

Parameters
uri:URI

the file name (may be null if this location does not correspond to a file)

XMLLocationback to summary
pack-priv XMLLocation(final XMLLocation includedFrom, final URI uri, final Location original)

Construct a new instance.

Parameters
uri:URI

the file name (may be null if this location does not correspond to a file)

original:Location

the location to copy the remainder of the information from

XMLLocationback to summary
pack-priv XMLLocation(final URI uri, final Location original)

Construct a new instance.

Parameters
uri:URI

the file name (may be null if this location does not correspond to a file)

original:Location

the location to copy the remainder of the information from

XMLLocationback to summary
pack-priv XMLLocation(final Location original)

Construct a new instance.

Parameters
original:Location

the location to copy the remainder of the information from

Method Detail

compareToback to summary
public int compareTo(final XMLLocation o)

Implements java.lang.Comparable.compareTo.

Compare for sort.

Parameters
o:XMLLocation

the other location

Returns:int

the sort result (-1, 0, or 1)

compareUriback to summary
private int compareUri(URI a, URI b)
equalsback to summary
public boolean equals(Object other)

Overrides java.lang.Object.equals.

Determine whether this object is equal to another.

Parameters
other:Object

the other object

Returns:boolean

true if they are equal, false otherwise

equalsback to summary
private static boolean equals(Object a, Object b)
equalsback to summary
public boolean equals(XMLLocation other)

Determine whether this object is equal to another.

Parameters
other:XMLLocation

the other object

Returns:boolean

true if they are equal, false otherwise

getCharacterOffsetback to summary
public int getCharacterOffset()

Implements javax.xml.stream.Location.getCharacterOffset.

Get the absolute character offset of this event. Returns -1 if not known.

Returns:int

the absolute character offset of this event

getColumnNumberback to summary
public int getColumnNumber()

Implements javax.xml.stream.Location.getColumnNumber.

Get the column number where the corresponding event ends. Returns -1 if not known.

Returns:int

the column number where the corresponding event ends

getIncludedFromback to summary
public XMLLocation getIncludedFrom()

Get the location that this location was included from. Returns null if this was the root document.

Returns:XMLLocation

the location that this location was included from, or null

getLineNumberback to summary
public int getLineNumber()

Implements javax.xml.stream.Location.getLineNumber.

Get the line number where the corresponding event ends. Returns -1 if not known.

Returns:int

the line number where the corresponding event ends

getPublicIdback to summary
public String getPublicId()

Implements javax.xml.stream.Location.getPublicId.

Get the public ID of the XML. Returns null if not known.

Returns:String

the public ID of the XML

getSystemIdback to summary
public String getSystemId()

Implements javax.xml.stream.Location.getSystemId.

Get the system ID of the XML. Returns null if not known.

Returns:String

the system ID of the XML

getUriback to summary
public URI getUri()

Get the file name. May be null if this location does not correspond to a file.

Returns:URI

the file name

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Get the location as a string. The string will be suitable for immediately prefixing an error message.

Returns:String

the location as a string

toStringback to summary
private void toString(final StringBuilder b)
toXMLLocationback to summary
public static XMLLocation toXMLLocation(final Location location)
toXMLLocationback to summary
public static XMLLocation toXMLLocation(final URI uri, final Location location)
toXMLLocationback to summary
public static XMLLocation toXMLLocation(final XMLLocation includedFrom, final Location location)
toXMLLocationback to summary
public static XMLLocation toXMLLocation(final XMLLocation includedFrom, final URI uri, final Location location)