Class GraphQLMarkdownGeneratorOptions

java.lang.Object
org.brapi.schematools.core.markdown.GraphQLMarkdownGeneratorOptions
All Implemented Interfaces:
Options, Validatable

public class GraphQLMarkdownGeneratorOptions extends Object implements Options
Options for the GraphQLGenerator.
  • Constructor Details

    • GraphQLMarkdownGeneratorOptions

      public GraphQLMarkdownGeneratorOptions()
  • Method Details

    • load

      public static GraphQLMarkdownGeneratorOptions load()
      Load the default options
      Returns:
      The default options
    • load

      public static GraphQLMarkdownGeneratorOptions load(Path optionsFile) throws IOException
      Load the options from an options file in YAML or Json. The options file may have missing (defined) values, in these cases the default values are loaded. See load()
      Parameters:
      optionsFile - The path to the options file in YAML or Json.
      Returns:
      The options loaded from the YAML or Json file.
      Throws:
      IOException - if the options file can not be found or is incorrectly formatted.
    • load

      public static GraphQLMarkdownGeneratorOptions load(InputStream inputStream) throws IOException
      Load the options from an options input stream in YAML or Json. The options file may have missing (defined) values, in these cases the default values are loaded. See load()
      Parameters:
      inputStream - The input stream in YAML or Json.
      Returns:
      The options loaded from input stream.
      Throws:
      IOException - if the input stream is not valid or the content is incorrectly formatted.
    • validate

      public Validation validate()
      Description copied from interface: Validatable
      Checks if the Validatable object is valid, return a list of errors if it is not valid
      Specified by:
      validate in interface Validatable
      Returns:
      a Validation object than can be used queried to find if the object is valid and any errors if it is not valid
    • override

      Overrides the values in this Options Object from the provided Options Object if they are non-null
      Parameters:
      overrideOptions - the options which will be used to override this Options Object
      Returns:
      this options for method chaining
    • isOverwritingExistingFiles

      public boolean isOverwritingExistingFiles()
      Determines if the Generator should Overwrite exiting files.
      Returns:
      true if the Generator should Overwrite exiting files, false otherwise
    • getDescriptionForObjectType

      public String getDescriptionForObjectType(graphql.schema.GraphQLObjectType type, graphql.schema.GraphQLOutputType dataType, graphql.schema.GraphQLFieldDefinition queryDefinition)
      Creates the description for a GraphQLObjectType
      Parameters:
      type - the GraphQLObjectType
      dataType - if the type is a Response with a data field, then this is the type of that field
      queryDefinition - the query associated with the response type
      Returns:
      the description for a GraphQLObjectType
    • getDescriptionForInputObjectType

      public String getDescriptionForInputObjectType(graphql.schema.GraphQLInputObjectType type, graphql.schema.GraphQLFieldDefinition queryDefinition)
      Creates the description for a GraphQLInputObjectType
      Parameters:
      type - the GraphQLInputObjectType
      queryDefinition - the query associated with the input field type
      Returns:
      the description for a GraphQLInputObjectType
    • getDescriptionForQuery

      public String getDescriptionForQuery(graphql.schema.GraphQLFieldDefinition queryDefinition, graphql.schema.GraphQLOutputType dataType, graphql.schema.GraphQLInputType inputType)
      Creates the query description for a Query
      Parameters:
      queryDefinition - the GraphQLFieldDefinition
      dataType - if the type is a Response with a data field, then this is the type of that field
      inputType - the query input type
      Returns:
      the query description for a GraphQLFieldDefinition
    • getDescriptionForListQuery

      public String getDescriptionForListQuery(graphql.schema.GraphQLFieldDefinition query, graphql.schema.GraphQLOutputType dataType, graphql.schema.GraphQLInputType inputType)
      Creates the query description for a List Query
      Parameters:
      query - the GraphQLFieldDefinition
      dataType - if the type is a Response with a data field, then this is the type of that field
      inputType - the query input type
      Returns:
      the query description for a GraphQLFieldDefinition
    • getDescriptionForSearchQuery

      public String getDescriptionForSearchQuery(graphql.schema.GraphQLFieldDefinition query, graphql.schema.GraphQLOutputType dataType, graphql.schema.GraphQLInputType inputType)
      Creates the query description for a Search Query
      Parameters:
      query - the GraphQLFieldDefinition
      dataType - if the type is a Response with a data field, then this is the type of that field
      inputType - the query input type
      Returns:
      the query description for a GraphQLFieldDefinition
    • getDescriptionForInterface

      public String getDescriptionForInterface(graphql.schema.GraphQLInterfaceType type)
      Creates the description for a GraphQLInterfaceType
      Parameters:
      type - the GraphQLInterfaceType
      Returns:
      the description for a GraphQLInterfaceType
    • getDescriptionForEnum

      public String getDescriptionForEnum(graphql.schema.GraphQLEnumType type)
      Creates the description for a GraphQLEnumType
      Parameters:
      type - the GraphQLEnumType
      Returns:
      the description for a GraphQLEnumType
    • getDescriptionForField

      public String getDescriptionForField(graphql.schema.GraphQLNamedType type, graphql.schema.GraphQLFieldDefinition field)
      Creates the description for a GraphQLFieldDefinition
      Parameters:
      type - the type to which this field belongs
      field - the GraphQLFieldDefinition
      Returns:
      the description for a GraphQLFieldDefinition
    • getDescriptionForInputField

      public String getDescriptionForInputField(graphql.schema.GraphQLInputObjectType type, graphql.schema.GraphQLFieldDefinition queryDefinition, graphql.schema.GraphQLInputObjectField field)
      Creates the description for a GraphQLInputObjectField
      Parameters:
      type - the type to which this field belongs
      queryDefinition - the query associated with the input field type
      field - the GraphQLInputObjectField
      Returns:
      the description for a GraphQLInputObjectField
    • getDescriptionForArgument

      public String getDescriptionForArgument(graphql.schema.GraphQLFieldDefinition queryDefinition, graphql.schema.GraphQLArgument argument)
      Creates the description for a GraphQLArgument
      Parameters:
      queryDefinition - the query definition to which this field belongs
      argument - the GraphQLArgument
      Returns:
      the description for a GraphQLArgument
    • isCreatingTopLevelFieldDefinitions

      public boolean isCreatingTopLevelFieldDefinitions()
      Determines if the Generator should create top level field descriptions when there is more than one field with the same name.
      Returns:
      true if the Generator should create top level field descriptions when there is more than one field with the same name, false otherwise
    • isCreatingTopLevelInputFieldDefinitions

      public boolean isCreatingTopLevelInputFieldDefinitions()
      Determines if the Generator should create top level input object field descriptions when there is more than one field with the same name.
      Returns:
      true if the Generator should create top level input object field descriptions when there is more than one field with the same name, false otherwise
    • isCreatingTopLevelArgumentDefinitions

      public boolean isCreatingTopLevelArgumentDefinitions()
      Determines if the Generator should create top level argument descriptions when there is more than one argument with the same name.
      Returns:
      true if the Generator should create top level argument descriptions when there is more than one argument with the same name, false otherwise