Class SourceLocation

java.lang.Object
graphql.language.SourceLocation
All Implemented Interfaces:
Serializable

@PublicApi @NullMarked public class SourceLocation extends Object implements Serializable
See Also:
  • Field Details

  • Constructor Details

    • SourceLocation

      public SourceLocation(int line, int column)
    • SourceLocation

      public SourceLocation(int line, int column, @Nullable String sourceName)
  • Method Details

    • getLine

      public int getLine()
    • getColumn

      public int getColumn()
    • getSourceName

      public @Nullable String getSourceName()
    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getLocation

      public static @Nullable SourceLocation getLocation(GraphQLSchemaElement schemaElement)
      This method can return SourceLocation that help create the given schema element. If the schema is created from input files and SchemaGenerator.Options.isCaptureAstDefinitions() is set to true then schema elements contain a reference to the SourceLocation that helped create that runtime schema element.
      Parameters:
      schemaElement - the schema element
      Returns:
      the source location if available or null if it's not.