Package cdc.issues.locations
Interface Location
-
- All Known Implementing Classes:
AbstractLocation,DefaultLocation,TextFileLocation,WorkbookLocation
public interface LocationBase 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 Modifier and Type Interface Description static classLocation.Builder
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static Location.Builderbuilder()StringgetAnchor()static StringgetAnchor(String location)StringgetPath()static StringgetPath(String location)default StringgetTag()static StringgetTag(String location)default booleanhasAnchor()static StringtoString(Location location)Encodes a Location to a String.
-
-
-
Field Detail
-
UNDEFINED
static final Location UNDEFINED
-
SEPARATOR
static final String SEPARATOR
- See Also:
- Constant Field Values
-
-
Method Detail
-
getTag
default String getTag()
- Returns:
- The string used to identify the implementation of this interface. It is used in serialization.
- See Also:
Locations
-
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.
-
toString
static String toString(Location location)
Encodes a Location to a String.The result is encoded as
Tag::Path[::Anchor].- Parameters:
location- The location.- Returns:
- The String representation of
location.
-
getTag
static String getTag(String location)
- Parameters:
location- The string encoding o a Location.- Returns:
- The Tag part of
location.
-
getPath
static String getPath(String location)
- Parameters:
location- The string encoding o a Location.- Returns:
- The Path part of
location.
-
getAnchor
static String getAnchor(String location)
- Parameters:
location- The string encoding o a Location.- Returns:
- The Anchor part of
location.
-
builder
static Location.Builder builder()
-
-