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.ProjectprojectbooleanskipGenerationIfSchemaHasNotChangedFields 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.StringgetEnumPrefix()An optional prefix to add to the classnames of the generated java classes for GraphQL enums.java.lang.StringgetEnumSuffix()An optional suffix to add to the classnames of the generated java classes for GraphQL enums.java.lang.StringgetInputPrefix()An optional prefix to add to the classnames of the generated java classes for GraphQL input objects.java.lang.StringgetInputSuffix()An optional suffix to add to the classnames of the generated java classes for GraphQL input objects.java.lang.StringgetInterfacePrefix()An optional prefix to add to the classnames of the generated java classes for GraphQL interfaces.java.lang.StringgetInterfaceSuffix()An optional suffix to add to the classnames of the generated java classes for GraphQL interfaces.java.lang.IntegergetMaxTokens()java.io.FilegetProjectDir()java.io.FilegetSchemaFileFolder()java.lang.StringgetSchemaFilePattern()java.util.Map<java.lang.String,java.lang.String>getTemplates()java.lang.StringgetTypePrefix()An optional prefix to add to the classnames of the generated java classes for GraphQL types.java.lang.StringgetTypeSuffix()An optional suffix to add to the classnames of the generated java classes for GraphQL types.java.lang.StringgetUnionPrefix()An optional prefix to add to the classnames of the generated java classes for GraphQL unions.java.lang.StringgetUnionSuffix()An optional suffix to add to the classnames of the generated java classes for GraphQL unions.booleanisAddRelayConnections()booleanisInitialized()booleanisSkipGenerationIfSchemaHasNotChanged()Deprecated.voidlogConfiguration()voidsetAddRelayConnections(boolean addRelayConnections)voidsetEnumPrefix(java.lang.String enumPrefix)voidsetEnumSuffix(java.lang.String enumSuffix)voidsetInitialized(boolean initialized)voidsetInputPrefix(java.lang.String inputPrefix)voidsetInputSuffix(java.lang.String inputSuffix)voidsetInterfacePrefix(java.lang.String interfacePrefix)voidsetInterfaceSuffix(java.lang.String interfaceSuffix)voidsetMaxTokens(java.lang.Integer maxTokens)voidsetSchemaFileFolder(java.lang.String schemaFileFolder)voidsetSchemaFilePattern(java.lang.String schemaFilePattern)voidsetSkipGenerationIfSchemaHasNotChanged(boolean skipGenerationIfSchemaHasNotChanged)voidsetTemplates(java.util.Map<java.lang.String,java.lang.String> templates)voidsetTypePrefix(java.lang.String typePrefix)voidsetTypeSuffix(java.lang.String typeSuffix)voidsetUnionPrefix(java.lang.String unionPrefix)voidsetUnionSuffix(java.lang.String unionSuffix)
-
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 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:
getEnumPrefixin interfacecom.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:
getEnumSuffixin interfacecom.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:
getInputPrefixin interfacecom.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:
getInputSuffixin interfacecom.graphql_java_generator.plugin.conf.CommonConfiguration
-
setInputSuffix
public void setInputSuffix(java.lang.String inputSuffix) -
getMaxTokens
public java.lang.Integer getMaxTokens()- Specified by:
getMaxTokensin interfacecom.graphql_java_generator.plugin.conf.CommonConfiguration
-
setMaxTokens
public void setMaxTokens(java.lang.Integer maxTokens) -
getProjectDir
public java.io.File getProjectDir()- Specified by:
getProjectDirin interfacecom.graphql_java_generator.plugin.conf.CommonConfiguration
-
getSchemaFileFolder
public java.io.File getSchemaFileFolder()- Specified by:
getSchemaFileFolderin interfacecom.graphql_java_generator.plugin.conf.CommonConfiguration
-
setSchemaFileFolder
public final void setSchemaFileFolder(java.lang.String schemaFileFolder) -
getSchemaFilePattern
public java.lang.String getSchemaFilePattern()- Specified by:
getSchemaFilePatternin interfacecom.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:
getTemplatesin interfacecom.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:
getTypePrefixin interfacecom.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:
getTypeSuffixin interfacecom.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:
getUnionPrefixin interfacecom.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:
getUnionSuffixin interfacecom.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:
getInterfacePrefixin interfacecom.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:
getInterfaceSuffixin interfacecom.graphql_java_generator.plugin.conf.CommonConfiguration
-
setInterfaceSuffix
public void setInterfaceSuffix(java.lang.String interfaceSuffix) -
isAddRelayConnections
public boolean isAddRelayConnections()- Specified by:
isAddRelayConnectionsin interfacecom.graphql_java_generator.plugin.conf.CommonConfiguration
-
setAddRelayConnections
public final void setAddRelayConnections(boolean addRelayConnections) -
isSkipGenerationIfSchemaHasNotChanged
@Deprecated public boolean isSkipGenerationIfSchemaHasNotChanged()Deprecated.- Specified by:
isSkipGenerationIfSchemaHasNotChangedin interfacecom.graphql_java_generator.plugin.conf.CommonConfiguration
-
setSkipGenerationIfSchemaHasNotChanged
public final void setSkipGenerationIfSchemaHasNotChanged(boolean skipGenerationIfSchemaHasNotChanged) -
logConfiguration
public void logConfiguration()- Specified by:
logConfigurationin interfacecom.graphql_java_generator.plugin.conf.CommonConfiguration
-