Package software.amazon.smithy.model
Class SourceLocation
- java.lang.Object
-
- software.amazon.smithy.model.SourceLocation
-
- All Implemented Interfaces:
FromSourceLocation
public final class SourceLocation extends java.lang.Object implements FromSourceLocation
Represents the source location of a model component.
-
-
Field Summary
Fields Modifier and Type Field Description static SourceLocation
NONE
-
Constructor Summary
Constructors Constructor Description SourceLocation(java.lang.String filename)
SourceLocation(java.lang.String filename, int line, int column)
-
Method Summary
Modifier and Type Method Description boolean
equals(java.lang.Object other)
int
getColumn()
java.lang.String
getFilename()
int
getLine()
SourceLocation
getSourceLocation()
Gets the source location of a value.int
hashCode()
static SourceLocation
none()
Creates an empty source location.java.lang.String
toString()
-
-
-
Field Detail
-
NONE
public static final SourceLocation NONE
-
-
Method Detail
-
none
public static SourceLocation none()
Creates an empty source location.- Returns:
- Returns the empty location.
-
getFilename
public java.lang.String 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
public SourceLocation 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
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-