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 SourceLocationEMPTY
-
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 booleanequals(java.lang.Object o)intgetColumn()intgetLine()static SourceLocationgetLocation(GraphQLSchemaElement schemaElement)This method can returnSourceLocationthat help create the given schema element.java.lang.StringgetSourceName()inthashCode()java.lang.StringtoString()
-
-
-
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:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getLocation
public static SourceLocation getLocation(GraphQLSchemaElement schemaElement)
This method can returnSourceLocationthat 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 theSourceLocationthat helped create that runtime schema element.- Parameters:
schemaElement- the schema element- Returns:
- the source location if available or null if it's not.
-
-