Class CommonExtension

java.lang.Object
com.graphql_java_generator.gradleplugin.CommonExtension
All Implemented Interfaces:
com.graphql_java_generator.plugin.conf.CommonConfiguration
Direct Known Subclasses:
GenerateCodeCommonExtension, GenerateGraphQLSchemaExtension

public class CommonExtension
extends java.lang.Object
implements com.graphql_java_generator.plugin.conf.CommonConfiguration

This class contain the parameters that are common to all Gradle Extensions for this plugin, that is the parameters that are common to all the tasks of this plugin. The extensions are used here to define the default values for the task parameters

This avoids to redeclare each common parameter in each Extension, including its comment. When a comment is updated, only one update is necessary, instead of updating it in each Extension.

  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected org.gradle.api.Project project  
    boolean skipGenerationIfSchemaHasNotChanged  

    Fields inherited from interface com.graphql_java_generator.plugin.conf.CommonConfiguration

    DEFAULT_ADD_RELAY_CONNECTIONS, DEFAULT_MAX_TOKENS, DEFAULT_PACKAGE_NAME, DEFAULT_SCHEMA_FILE_FOLDER, DEFAULT_SCHEMA_FILE_PATTERN, DEFAULT_SKIP_GENERATION_IF_SCHEMA_HAS_NOT_CHANGED
  • Constructor Summary

    Constructors 
    Constructor Description
    CommonExtension​(org.gradle.api.Project project)  
  • Method Summary

    Modifier and Type Method Description
    java.lang.Integer getMaxTokens()  
    java.io.File getProjectDir()  
    java.io.File getSchemaFileFolder()  
    java.lang.String getSchemaFilePattern()  
    java.util.Map<java.lang.String,​java.lang.String> getTemplates()  
    boolean isAddRelayConnections()  
    boolean isSkipGenerationIfSchemaHasNotChanged()  
    void logConfiguration()  
    void setAddRelayConnections​(boolean addRelayConnections)  
    void setMaxTokens​(java.lang.Integer maxTokens)  
    void setSchemaFileFolder​(java.lang.String schemaFileFolder)  
    void setSchemaFilePattern​(java.lang.String schemaFilePattern)  
    void setSkipGenerationIfSchemaHasNotChanged​(boolean skipGenerationIfSchemaHasNotChanged)  
    void setTemplates​(java.util.Map<java.lang.String,​java.lang.String> templates)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.graphql_java_generator.plugin.conf.CommonConfiguration

    getDefaultTargetSchemaFileName, isGenerateJacksonAnnotations, logCommonConfiguration
  • Field Details

  • Constructor Details

    • CommonExtension

      public CommonExtension​(org.gradle.api.Project project)
  • Method Details

    • getMaxTokens

      public java.lang.Integer getMaxTokens()
      Specified by:
      getMaxTokens in interface com.graphql_java_generator.plugin.conf.CommonConfiguration
    • setMaxTokens

      public void setMaxTokens​(java.lang.Integer maxTokens)
    • getProjectDir

      public java.io.File getProjectDir()
      Specified by:
      getProjectDir in interface com.graphql_java_generator.plugin.conf.CommonConfiguration
    • getSchemaFileFolder

      public java.io.File getSchemaFileFolder()
      Specified by:
      getSchemaFileFolder in interface com.graphql_java_generator.plugin.conf.CommonConfiguration
    • setSchemaFileFolder

      public final void setSchemaFileFolder​(java.lang.String schemaFileFolder)
    • getSchemaFilePattern

      public java.lang.String getSchemaFilePattern()
      Specified by:
      getSchemaFilePattern in interface com.graphql_java_generator.plugin.conf.CommonConfiguration
    • setSchemaFilePattern

      public final void setSchemaFilePattern​(java.lang.String schemaFilePattern)
    • getTemplates

      public java.util.Map<java.lang.String,​java.lang.String> getTemplates()
      Specified by:
      getTemplates in interface com.graphql_java_generator.plugin.conf.CommonConfiguration
    • setTemplates

      public final void setTemplates​(java.util.Map<java.lang.String,​java.lang.String> templates)
    • isAddRelayConnections

      public boolean isAddRelayConnections()
      Specified by:
      isAddRelayConnections in interface com.graphql_java_generator.plugin.conf.CommonConfiguration
    • setAddRelayConnections

      public final void setAddRelayConnections​(boolean addRelayConnections)
    • isSkipGenerationIfSchemaHasNotChanged

      public boolean isSkipGenerationIfSchemaHasNotChanged()
      Specified by:
      isSkipGenerationIfSchemaHasNotChanged in interface com.graphql_java_generator.plugin.conf.CommonConfiguration
    • setSkipGenerationIfSchemaHasNotChanged

      public final void setSkipGenerationIfSchemaHasNotChanged​(boolean skipGenerationIfSchemaHasNotChanged)
    • logConfiguration

      public void logConfiguration()
      Specified by:
      logConfiguration in interface com.graphql_java_generator.plugin.conf.CommonConfiguration