Package org.apache.maven.api.model
Class InputLocation
java.lang.Object
org.apache.maven.api.model.InputLocation
- All Implemented Interfaces:
Serializable
,InputLocationTracker
Class InputLocation.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Class StringFormatter. -
Constructor Summary
ConstructorDescriptionInputLocation
(int lineNumber, int columnNumber) InputLocation
(int lineNumber, int columnNumber, InputSource source) InputLocation
(int lineNumber, int columnNumber, InputSource source, Object selfLocationKey) InputLocation
(int lineNumber, int columnNumber, InputSource source, Map<Object, InputLocation> locations) InputLocation
(InputLocation original) InputLocation
(InputSource source) -
Method Summary
Modifier and TypeMethodDescriptionint
Gets the parent InputLocation where this InputLocation may have been imported from.int
getLocation
(Object key) static InputLocation
merge
(InputLocation target, InputLocation source, boolean sourceDominant) Merges thesource
location into thetarget
location.static InputLocation
merge
(InputLocation target, InputLocation source, Collection<Integer> indices) Merges thesource
location into thetarget
location.toString()
-
Constructor Details
-
InputLocation
-
InputLocation
public InputLocation(int lineNumber, int columnNumber) -
InputLocation
-
InputLocation
-
InputLocation
public InputLocation(int lineNumber, int columnNumber, InputSource source, Map<Object, InputLocation> locations) -
InputLocation
-
-
Method Details
-
getLineNumber
public int getLineNumber() -
getColumnNumber
public int getColumnNumber() -
getSource
-
getLocation
- Specified by:
getLocation
in interfaceInputLocationTracker
-
getLocations
-
getImportedFrom
Gets the parent InputLocation where this InputLocation may have been imported from. Can returnnull
.- Specified by:
getImportedFrom
in interfaceInputLocationTracker
- Returns:
- InputLocation
- Since:
- 4.0.0
-
merge
public static InputLocation merge(InputLocation target, InputLocation source, boolean sourceDominant) Merges thesource
location into thetarget
location.- Parameters:
target
- the target locationsource
- the source locationsourceDominant
- the boolean indicating ofsource
is dominant compared totarget
- Returns:
- the merged location
-
merge
public static InputLocation merge(InputLocation target, InputLocation source, Collection<Integer> indices) Merges thesource
location into thetarget
location. This method is used when the locations refer to lists and also merges the indices.- Parameters:
target
- the target locationsource
- the source locationindices
- the list of integers for the indices- Returns:
- the merged location
-
toString
-