Package org.apache.maven.model
Class InputLocation
java.lang.Object
org.apache.maven.model.InputLocation
- All Implemented Interfaces:
Serializable,Cloneable,InputLocationTracker
public final class InputLocation
extends Object
implements Serializable, Cloneable, InputLocationTracker
Class InputLocation.
- Version:
- $Revision$ $Date$
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classClass StringFormatter. -
Constructor Summary
ConstructorsConstructorDescriptionInputLocation(int lineNumber, int columnNumber) InputLocation(int lineNumber, int columnNumber, InputSource source) InputLocation(InputLocation location) Creates a new InputLocation from an API model InputLocation. -
Method Summary
Modifier and TypeMethodDescriptionclone()Method clone.booleanintGet the one-based column number.Gets the parent InputLocation where this InputLocation may have been imported from.intGet the one-based line number.getLocation(Object key) Gets the InputLocation for a specific nested element key.Gets the map of nested element locations within this location.Get the source field.inthashCode()static InputLocationmerge(InputLocation target, InputLocation source, boolean sourceDominant) Method merge.static InputLocationmerge(InputLocation target, InputLocation source, Collection<Integer> indices) Method merge.voidsetImportedFrom(InputLocation importedFrom) Set the imported from location.voidsetLocation(Object key, InputLocation location) Sets the InputLocation for a specific nested element key.voidsetLocations(Map<Object, InputLocation> locations) voidsetOtherLocation(Object key, InputLocation location) Sets the InputLocation for a specific nested element key in the locations map.Converts this compat model InputLocation to an API model InputLocation.toString()
-
Constructor Details
-
InputLocation
Creates a new InputLocation from an API model InputLocation. This constructor is used for converting between the API model and the compat model.- Parameters:
location- the API model InputLocation to convert from
-
InputLocation
public InputLocation(int lineNumber, int columnNumber) -
InputLocation
-
-
Method Details
-
clone
Method clone. -
getColumnNumber
public int getColumnNumber()Get the one-based column number. The value will be non-positive if unknown.- Returns:
- int
-
getLineNumber
public int getLineNumber()Get the one-based line number. The value will be non-positive if unknown.- Returns:
- int
-
getLocation
Gets the InputLocation for a specific nested element key.- Specified by:
getLocationin interfaceInputLocationTracker- Parameters:
key- the key to look up- Returns:
- the InputLocation for the specified key, or null if not found
-
getLocations
Gets the map of nested element locations within this location.- Returns:
- a map of keys to InputLocation instances for nested elements, or null if none
-
setLocation
Sets the InputLocation for a specific nested element key.- Specified by:
setLocationin interfaceInputLocationTracker- Parameters:
key- the key to set the location forlocation- the InputLocation to associate with the key
-
setOtherLocation
Sets the InputLocation for a specific nested element key in the locations map. This is a helper method that manages the internal locations map.- Parameters:
key- the key to set the location forlocation- the InputLocation to associate with the key
-
getSource
Get the source field.- Returns:
- InputSource
-
getImportedFrom
Gets the parent InputLocation where this InputLocation may have been imported from. Can returnnull.- Returns:
- InputLocation
- Since:
- 4.0.0
-
setImportedFrom
Set the imported from location.- Parameters:
importedFrom-
-
merge
public static InputLocation merge(InputLocation target, InputLocation source, boolean sourceDominant) Method merge.- Parameters:
target-source-sourceDominant-- Returns:
- InputLocation
-
merge
public static InputLocation merge(InputLocation target, InputLocation source, Collection<Integer> indices) Method merge.- Parameters:
target-source-indices-- Returns:
- InputLocation
-
setLocations
- Parameters:
locations-
-
toApiLocation
Converts this compat model InputLocation to an API model InputLocation. This method is used for converting between the compat model and the API model.- Returns:
- the equivalent API model InputLocation
-
equals
-
hashCode
public int hashCode() -
toString
-