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_PREFIX, DEFAULT_SCHEMA_FILE_FOLDER, DEFAULT_SCHEMA_FILE_PATTERN, DEFAULT_SKIP_GENERATION_IF_SCHEMA_HAS_NOT_CHANGED, DEFAULT_SUFFIX
  • Constructor Summary

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

    Modifier and Type Method Description
    java.lang.String getEnumPrefix()
    An optional prefix to add to the classnames of the generated java classes for GraphQL enums.
    java.lang.String getEnumSuffix()
    An optional suffix to add to the classnames of the generated java classes for GraphQL enums.
    java.lang.String getInputPrefix()
    An optional prefix to add to the classnames of the generated java classes for GraphQL input objects.
    java.lang.String getInputSuffix()
    An optional suffix to add to the classnames of the generated java classes for GraphQL input objects.
    java.lang.String getInterfacePrefix()
    An optional prefix to add to the classnames of the generated java classes for GraphQL interfaces.
    java.lang.String getInterfaceSuffix()
    An optional suffix to add to the classnames of the generated java classes for GraphQL interfaces.
    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()  
    java.lang.String getTypePrefix()
    An optional prefix to add to the classnames of the generated java classes for GraphQL types.
    java.lang.String getTypeSuffix()
    An optional suffix to add to the classnames of the generated java classes for GraphQL types.
    java.lang.String getUnionPrefix()
    An optional prefix to add to the classnames of the generated java classes for GraphQL unions.
    java.lang.String getUnionSuffix()
    An optional suffix to add to the classnames of the generated java classes for GraphQL unions.
    boolean isAddRelayConnections()  
    boolean isInitialized()  
    boolean isSkipGenerationIfSchemaHasNotChanged()
    Deprecated.
    void logConfiguration()  
    void setAddRelayConnections​(boolean addRelayConnections)  
    void setEnumPrefix​(java.lang.String enumPrefix)  
    void setEnumSuffix​(java.lang.String enumSuffix)  
    void setInitialized​(boolean initialized)  
    void setInputPrefix​(java.lang.String inputPrefix)  
    void setInputSuffix​(java.lang.String inputSuffix)  
    void setInterfacePrefix​(java.lang.String interfacePrefix)  
    void setInterfaceSuffix​(java.lang.String interfaceSuffix)  
    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)  
    void setTypePrefix​(java.lang.String typePrefix)  
    void setTypeSuffix​(java.lang.String typeSuffix)  
    void setUnionPrefix​(java.lang.String unionPrefix)  
    void setUnionSuffix​(java.lang.String unionSuffix)  

    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

    • getEnumPrefix

      public java.lang.String getEnumPrefix()
      An optional prefix to add to the classnames of the generated java classes for GraphQL enums. The prefix is added at the beginning of the java classname, and must be compatible with java naming rules (no space, dot, comma, etc.)
      Specified by:
      getEnumPrefix in interface com.graphql_java_generator.plugin.conf.CommonConfiguration
    • setEnumPrefix

      public void setEnumPrefix​(java.lang.String enumPrefix)
    • getEnumSuffix

      public java.lang.String getEnumSuffix()
      An optional suffix to add to the classnames of the generated java classes for GraphQL enums. The suffix is added at the end of the java classname, and must be compatible with java naming rules (no space, dot, comma, etc.)
      Specified by:
      getEnumSuffix in interface com.graphql_java_generator.plugin.conf.CommonConfiguration
    • setEnumSuffix

      public void setEnumSuffix​(java.lang.String enumSuffix)
    • isInitialized

      public boolean isInitialized()
    • setInitialized

      public void setInitialized​(boolean initialized)
    • getInputPrefix

      public java.lang.String getInputPrefix()
      An optional prefix to add to the classnames of the generated java classes for GraphQL input objects. The prefix is added at the beginning of the java classname, and must be compatible with java naming rules (no space, dot, comma, etc.)
      Specified by:
      getInputPrefix in interface com.graphql_java_generator.plugin.conf.CommonConfiguration
    • setInputPrefix

      public void setInputPrefix​(java.lang.String inputPrefix)
    • getInputSuffix

      public java.lang.String getInputSuffix()
      An optional suffix to add to the classnames of the generated java classes for GraphQL input objects. The suffix is added at the end of the java classname, and must be compatible with java naming rules (no space, dot, comma, etc.)
      Specified by:
      getInputSuffix in interface com.graphql_java_generator.plugin.conf.CommonConfiguration
    • setInputSuffix

      public void setInputSuffix​(java.lang.String inputSuffix)
    • 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)
    • getTypePrefix

      public java.lang.String getTypePrefix()
      An optional prefix to add to the classnames of the generated java classes for GraphQL types. The prefix is added at the beginning of the java classname, and must be compatible with java naming rules (no space, dot, comma, etc.)
      Specified by:
      getTypePrefix in interface com.graphql_java_generator.plugin.conf.CommonConfiguration
    • setTypePrefix

      public void setTypePrefix​(java.lang.String typePrefix)
    • getTypeSuffix

      public java.lang.String getTypeSuffix()
      An optional suffix to add to the classnames of the generated java classes for GraphQL types. The suffix is added at the end of the java classname, and must be compatible with java naming rules (no space, dot, comma, etc.)
      Specified by:
      getTypeSuffix in interface com.graphql_java_generator.plugin.conf.CommonConfiguration
    • setTypeSuffix

      public void setTypeSuffix​(java.lang.String typeSuffix)
    • getUnionPrefix

      public java.lang.String getUnionPrefix()
      An optional prefix to add to the classnames of the generated java classes for GraphQL unions. The prefix is added at the beginning of the java classname, and must be compatible with java naming rules (no space, dot, comma, etc.)
      Specified by:
      getUnionPrefix in interface com.graphql_java_generator.plugin.conf.CommonConfiguration
    • setUnionPrefix

      public void setUnionPrefix​(java.lang.String unionPrefix)
    • getUnionSuffix

      public java.lang.String getUnionSuffix()
      An optional suffix to add to the classnames of the generated java classes for GraphQL unions. The suffix is added at the end of the java classname, and must be compatible with java naming rules (no space, dot, comma, etc.)
      Specified by:
      getUnionSuffix in interface com.graphql_java_generator.plugin.conf.CommonConfiguration
    • setUnionSuffix

      public void setUnionSuffix​(java.lang.String unionSuffix)
    • getInterfacePrefix

      public java.lang.String getInterfacePrefix()
      An optional prefix to add to the classnames of the generated java classes for GraphQL interfaces. The prefix is added at the beginning of the java classname, and must be compatible with java naming rules (no space, dot, comma, etc.)
      Specified by:
      getInterfacePrefix in interface com.graphql_java_generator.plugin.conf.CommonConfiguration
    • setInterfacePrefix

      public void setInterfacePrefix​(java.lang.String interfacePrefix)
    • getInterfaceSuffix

      public java.lang.String getInterfaceSuffix()
      An optional suffix to add to the classnames of the generated java classes for GraphQL interfaces. The suffix is added at the end of the java classname, and must be compatible with java naming rules (no space, dot, comma, etc.)
      Specified by:
      getInterfaceSuffix in interface com.graphql_java_generator.plugin.conf.CommonConfiguration
    • setInterfaceSuffix

      public void setInterfaceSuffix​(java.lang.String interfaceSuffix)
    • isAddRelayConnections

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

      public final void setAddRelayConnections​(boolean addRelayConnections)
    • isSkipGenerationIfSchemaHasNotChanged

      @Deprecated public boolean isSkipGenerationIfSchemaHasNotChanged()
      Deprecated.
      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