Package software.amazon.smithy.model
Class SourceLocation
java.lang.Object
software.amazon.smithy.model.SourceLocation
- All Implemented Interfaces:
Comparable<SourceLocation>
,FromSourceLocation
public final class SourceLocation
extends Object
implements FromSourceLocation, Comparable<SourceLocation>
Represents the source location of a model component.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionSourceLocation
(String filename) SourceLocation
(String filename, int line, int column) -
Method Summary
Modifier and TypeMethodDescriptionint
boolean
int
int
getLine()
Gets the source location of a value.int
hashCode()
static SourceLocation
none()
Creates an empty source location.toString()
-
Field Details
-
NONE
-
-
Constructor Details
-
SourceLocation
-
SourceLocation
-
-
Method Details
-
none
Creates an empty source location.- Returns:
- Returns the empty location.
-
getFilename
- Returns:
- Returns the source location filename.
-
getLine
public int getLine()- Returns:
- Returns the line number from which the component originated.
-
getColumn
public int getColumn()- Returns:
- Returns the column from which the component originated.
-
getSourceLocation
Description copied from interface:FromSourceLocation
Gets the source location of a value.- Specified by:
getSourceLocation
in interfaceFromSourceLocation
- Returns:
- Returns the source location of the value.
-
toString
-
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareTo
in interfaceComparable<SourceLocation>
-