Package org.apache.maven.api.settings
Class InputLocation
java.lang.Object
org.apache.maven.api.settings.InputLocation
- All Implemented Interfaces:
Serializable,InputLocationTracker
Class InputLocation.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceClass StringFormatter. -
Constructor Summary
ConstructorsConstructorDescriptionInputLocation(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(InputSource source) -
Method Summary
Modifier and TypeMethodDescriptionintintgetLocation(Object key) Gets the location of the specified field in the input source.static InputLocationmerge(InputLocation target, InputLocation source, boolean sourceDominant) Merges thesourcelocation into thetargetlocation.static InputLocationmerge(InputLocation target, InputLocation source, Collection<Integer> indices) Merges thesourcelocation into thetargetlocation.
-
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)
-
-
Method Details
-
getLineNumber
public int getLineNumber() -
getColumnNumber
public int getColumnNumber() -
getSource
-
getLocation
Description copied from interface:InputLocationTrackerGets the location of the specified field in the input source.- Specified by:
getLocationin interfaceInputLocationTracker- Parameters:
key- the key of the field, must not benull- Returns:
- the location of the field in the input source or
nullif unknown
-
getLocations
-
merge
public static InputLocation merge(InputLocation target, InputLocation source, boolean sourceDominant) Merges thesourcelocation into thetargetlocation.- Parameters:
target- the target locationsource- the source locationsourceDominant- the boolean indicating ofsourceis dominant compared totarget- Returns:
- the merged location
-
merge
public static InputLocation merge(InputLocation target, InputLocation source, Collection<Integer> indices) Merges thesourcelocation into thetargetlocation. 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
-