Package cdc.issues.locations
Interface Location
- All Superinterfaces:
Comparable<Location>
- All Known Implementing Classes:
AbstractLocation,DefaultLocation,TextFileLocation,WorkbookLocation
Base interface used to describe a location inside a resource.
It is composed of 2 parts:
- external: the path to a resource,
- internal: the anchor that optionally designates something inside the resource.
- Author:
- Damien Carbonne
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic Location.Builderbuilder()default intstatic StringgetPath()static Stringdefault StringgetTag()static Stringdefault booleandefault StringtoString(boolean addTag) static StringEncodes a Location to a String.static StringEncodes a Location to a String.
-
Field Details
-
UNDEFINED
-
SEPARATOR
The string used to join the different parts (tag::path::anchor) of a location.- See Also:
-
-
Method Details
-
getTag
- Returns:
- The string used to identify the implementation of this interface. It is used in serialization.
- See Also:
-
getPath
String getPath()- Returns:
- The external part of the location, the path of the designated resource.
It is typically a file name, an URI, a kind of 'absolute' identifier.
-
getAnchor
String getAnchor()- Returns:
- The internal part of the location, inside the resource.
It may be
null.
-
hasAnchor
default boolean hasAnchor()- Returns:
trueif this location has a meaningful anchor.
-
compareTo
- Specified by:
compareToin interfaceComparable<Location>
-
toString
-
toString
Encodes a Location to a String.The result is encoded as
Tag::Path[::Anchor]or asPath[::Anchor],* depending on the value ofaddTag.WARRNING: if tag is missing, one can not reconstruct the original location from the string representation.
- Parameters:
location- The location.addTag- Iftrue, the location tag is included.- Returns:
- A String representation of
location.
-
toString
Encodes a Location to a String.The result is encoded as
Tag::Path[::Anchor].- Parameters:
location- The location.- Returns:
- A String representation of
location.
-
getTag
- Parameters:
location- The string encoding of a Location.- Returns:
- The Tag part of
location.
-
getPath
- Parameters:
location- The string encoding of a Location.- Returns:
- The Path part of
location.
-
getAnchor
- Parameters:
location- The string encoding of a Location.- Returns:
- The Anchor part of
location.
-
builder
-