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 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 Details

    • project

      protected final org.gradle.api.Project project
    • skipGenerationIfSchemaHasNotChanged

      public boolean skipGenerationIfSchemaHasNotChanged
  • Constructor Details

    • CommonExtension

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

    • getEnumPrefix

      public 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(String enumPrefix)
    • getEnumSuffix

      public 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(String enumSuffix)
    • isInitialized

      public boolean isInitialized()
    • setInitialized

      public void setInitialized(boolean initialized)
    • getInputPrefix

      public 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(String inputPrefix)
    • getInputSuffix

      public 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(String inputSuffix)
    • getMaxTokens

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

      public void setMaxTokens(Integer maxTokens)
    • getProjectDir

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

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

      public final void setSchemaFileFolder(String schemaFileFolder)
    • getSchemaFilePattern

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

      public final void setSchemaFilePattern(String schemaFilePattern)
    • getTemplates

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

      public final void setTemplates(Map<String,String> templates)
    • getTypePrefix

      public 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(String typePrefix)
    • getTypeSuffix

      public 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(String typeSuffix)
    • getUnionPrefix

      public 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(String unionPrefix)
    • getUnionSuffix

      public 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(String unionSuffix)
    • getInterfacePrefix

      public 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(String interfacePrefix)
    • getInterfaceSuffix

      public 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(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