Class AbstractCommonMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
com.graphql_java_generator.mavenplugin.AbstractCommonMojo
- All Implemented Interfaces:
CommonConfiguration,org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
AbstractGenerateCodeCommonMojo,AbstractGenerateGraphQLSchemaMojo
public abstract class AbstractCommonMojo
extends org.apache.maven.plugin.AbstractMojo
implements CommonConfiguration
This class is the super class of all Mojos. It contains all parameters that are common to all goals, and the
This avoids to redeclare each common parameter in each Mojo, including its comment. When a comment is updated, only one update is necessary, instead of updating it in each Mojo.
execute() method.This avoids to redeclare each common parameter in each Mojo, including its comment. When a comment is updated, only one update is necessary, instead of updating it in each Mojo.
- Author:
- etienne-sf
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.sonatype.plexus.build.incremental.BuildContextThe MavenBuildContextthat allows to link the build with the IDEprotected org.springframework.context.annotation.AnnotationConfigApplicationContextThe Spring context used for the plugin execution.An optional prefix to add to the classnames of the generated java classes for GraphQL enums.An optional suffix to add to the classnames of the generated java classes for GraphQL enums.An optional prefix to add to the classnames of the generated java classes for GraphQL input objects.An optional suffix to add to the classnames of the generated java classes for GraphQL input objects.An optional prefix to add to the classnames of the generated java classes for GraphQL interfaces.An optional suffix to add to the classnames of the generated java classes for GraphQL interfaces.(Useless, since 1.18.7)Defines the options that maximum number of tokens that the GraphQL schema parser may read.protected org.apache.maven.project.MavenProjectHelperprotected final Class<?>This class contains the Spring configuration for the actual instance of this Mojo.An optional prefix to add to the classnames of the generated java classes for GraphQL types.An optional suffix to add to the classnames of the generated java classes for GraphQL types.An optional prefix to add to the classnames of the generated java classes for GraphQL unions.An optional suffix to add to the classnames of the generated java classes for GraphQL unions.Fields inherited from interface com.graphql_java_generator.plugin.conf.CommonConfiguration
DEFAULT_ADD_RELAY_CONNECTIONS, DEFAULT_JSON_GRAPHQL_SCHEMA_FILE, DEFAULT_MAX_TOKENS, DEFAULT_PACKAGE_NAME, DEFAULT_PREFIX, DEFAULT_SCHEMA_FILE_FOLDER, DEFAULT_SCHEMA_FILE_PATTERN, DEFAULT_SCHEMA_SUB_FOLDER, DEFAULT_SKIP_GENERATION_IF_SCHEMA_HAS_NOT_CHANGED, DEFAULT_SUFFIX, DEFAULT_TARGET_SCHEMA_SUBFOLDERFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Method Summary
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.graphql_java_generator.plugin.conf.CommonConfiguration
getDefaultTargetSchemaFileName, isAddRelayConnections, isGenerateJacksonAnnotations, logCommonConfiguration, logConfiguration
-
Field Details
-
buildContext
@Component protected org.sonatype.plexus.build.incremental.BuildContext buildContextThe MavenBuildContextthat allows to link the build with the IDE -
projectHelper
@Component protected org.apache.maven.project.MavenProjectHelper projectHelper -
unionSuffix
@Parameter(property="com.graphql_java_generator.mavenplugin.unionSuffix", defaultValue="") public String unionSuffixAn 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.) -
enumPrefix
@Parameter(property="com.graphql_java_generator.mavenplugin.enumPrefix", defaultValue="") public String enumPrefixAn 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.) -
enumSuffix
@Parameter(property="com.graphql_java_generator.mavenplugin.enumSuffix", defaultValue="") public String enumSuffixAn 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.) -
interfacePrefix
@Parameter(property="com.graphql_java_generator.mavenplugin.interfacePrefix", defaultValue="") public String interfacePrefixAn 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.) -
interfaceSuffix
@Parameter(property="com.graphql_java_generator.mavenplugin.interfaceSuffix", defaultValue="") public String interfaceSuffixAn 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.) -
inputPrefix
@Parameter(property="com.graphql_java_generator.mavenplugin.inputPrefix", defaultValue="") public String inputPrefixAn 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.) -
inputSuffix
@Parameter(property="com.graphql_java_generator.mavenplugin.javaClassSuffix", defaultValue="") public String inputSuffixAn 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.) -
jsonGraphqlSchemaFilename
@Parameter(property="com.graphql_java_generator.mavenplugin.jsonGraphqlSchemaFilename", defaultValue="") public String jsonGraphqlSchemaFilename -
maxTokens
@Parameter(property="com.graphql_java_generator.mavenplugin.maxTokens", defaultValue="2147483647") public Integer maxTokens(Useless, since 1.18.7)Defines the options that maximum number of tokens that the GraphQL schema parser may read. The default value is Integer.MAX_VALUE (=2147483647). If the schema contains more than maxTokens, the build will fail with an error. -
typePrefix
@Parameter(property="com.graphql_java_generator.mavenplugin.typePrefix", defaultValue="") public String typePrefixAn 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.) -
typeSuffix
@Parameter(property="com.graphql_java_generator.mavenplugin.typeSuffix", defaultValue="") public String typeSuffixAn 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.) -
unionPrefix
@Parameter(property="com.graphql_java_generator.mavenplugin.unionPrefix", defaultValue="") public String unionPrefixAn 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.) -
springConfigurationClass
This class contains the Spring configuration for the actual instance of this Mojo. It's set by subclasses, through the constructor -
ctx
protected org.springframework.context.annotation.AnnotationConfigApplicationContext ctxThe Spring context used for the plugin execution. It contains all the beans that runs for its execution
-
-
Method Details
-
getEnumPrefix
- Specified by:
getEnumPrefixin interfaceCommonConfiguration
-
getEnumSuffix
- Specified by:
getEnumSuffixin interfaceCommonConfiguration
-
getInputPrefix
- Specified by:
getInputPrefixin interfaceCommonConfiguration
-
getInputSuffix
- Specified by:
getInputSuffixin interfaceCommonConfiguration
-
getInterfacePrefix
- Specified by:
getInterfacePrefixin interfaceCommonConfiguration
-
getInterfaceSuffix
- Specified by:
getInterfaceSuffixin interfaceCommonConfiguration
-
getJsonGraphqlSchemaFilename
- Specified by:
getJsonGraphqlSchemaFilenamein interfaceCommonConfiguration
-
getMaxTokens
- Specified by:
getMaxTokensin interfaceCommonConfiguration
-
getProjectBuildDir
- Specified by:
getProjectBuildDirin interfaceCommonConfiguration
-
getProjectDir
- Specified by:
getProjectDirin interfaceCommonConfiguration
-
getProjectMainSourceFolder
- Specified by:
getProjectMainSourceFolderin interfaceCommonConfiguration
-
getSchemaFileFolder
- Specified by:
getSchemaFileFolderin interfaceCommonConfiguration
-
getSchemaFilePattern
- Specified by:
getSchemaFilePatternin interfaceCommonConfiguration
-
getTargetSchemaSubFolder
- Specified by:
getTargetSchemaSubFolderin interfaceCommonConfiguration
-
getTemplates
- Specified by:
getTemplatesin interfaceCommonConfiguration
-
getTypePrefix
- Specified by:
getTypePrefixin interfaceCommonConfiguration
-
getTypeSuffix
- Specified by:
getTypeSuffixin interfaceCommonConfiguration
-
getUnionPrefix
- Specified by:
getUnionPrefixin interfaceCommonConfiguration
-
getUnionSuffix
- Specified by:
getUnionSuffixin interfaceCommonConfiguration
-
isSkipGenerationIfSchemaHasNotChanged
public boolean isSkipGenerationIfSchemaHasNotChanged()- Specified by:
isSkipGenerationIfSchemaHasNotChangedin interfaceCommonConfiguration
-
execute
public final void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Specified by:
executein interfaceorg.apache.maven.plugin.Mojo- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
executePostExecutionTask
- Throws:
IOException
-