Package graphql.language
Class SourceLocation
- java.lang.Object
-
- graphql.language.SourceLocation
-
- All Implemented Interfaces:
java.io.Serializable
@PublicApi public class SourceLocation extends java.lang.Object implements java.io.Serializable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static SourceLocation
EMPTY
-
Constructor Summary
Constructors Constructor Description SourceLocation(int line, int column)
SourceLocation(int line, int column, java.lang.String sourceName)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
int
getColumn()
int
getLine()
static SourceLocation
getLocation(GraphQLSchemaElement schemaElement)
This method can returnSourceLocation
that help create the given schema element.java.lang.String
getSourceName()
int
hashCode()
java.lang.String
toString()
-
-
-
Field Detail
-
EMPTY
public static final SourceLocation EMPTY
-
-
Method Detail
-
getLine
public int getLine()
-
getColumn
public int getColumn()
-
getSourceName
public java.lang.String getSourceName()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getLocation
public static SourceLocation getLocation(GraphQLSchemaElement schemaElement)
This method can returnSourceLocation
that help create the given schema element. If the schema is created from input files andSchemaGenerator.Options.isCaptureAstDefinitions()
is set to true then schema elements contain a reference to theSourceLocation
that helped create that runtime schema element.- Parameters:
schemaElement
- the schema element- Returns:
- the source location if available or null if it's not.
-
-