Class InputSource
java.lang.Object
org.apache.maven.api.cli.extensions.InputSource
- All Implemented Interfaces:
Serializable
Represents the source of a model input, such as a POM file.
This class tracks the origin of model elements, providing location information used primarily for error reporting and debugging to help identify where specific model elements came from. The location typically represents a file path, URL, or other identifier that describes the source of the input.
InputSource instances are immutable and can be safely shared across threads. The class provides factory methods for convenient creation of instances.
- Since:
- 4.0.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanGets the parent InputLocation where this InputLocation may have been imported from.Gets the path/URL of the input source ornullif unknown.inthashCode()static InputSourcemerge(InputSource src1, InputSource src2) Merges two InputSource instances into a single merged InputSource.static InputSourceCreates a new InputSource with the specified location.toString()
-
Constructor Details
-
InputSource
-
-
Method Details
-
of
Creates a new InputSource with the specified location. The location typically represents a file path, URL, or other identifier that describes where the input originated from.- Parameters:
location- the path/URL of the input source, may be null- Returns:
- a new InputSource instance
-
getLocation
Gets the path/URL of the input source ornullif unknown.The location typically represents a file path, URL, or other identifier that describes where the input originated from. This information is primarily used for error reporting and debugging purposes.
- Returns:
- the location string, or null if unknown
-
getImportedFrom
Gets the parent InputLocation where this InputLocation may have been imported from. Can returnnull.- Returns:
- InputLocation
- Since:
- 4.0.0
-
equals
-
hashCode
public int hashCode() -
toString
-
merge
Merges two InputSource instances into a single merged InputSource. The resulting InputSource will contain all distinct sources from both inputs.- Parameters:
src1- the first input source to mergesrc2- the second input source to merge- Returns:
- a new merged InputSource containing all distinct sources from both inputs
-