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
Modifier and TypeFieldDescriptionprotected org.sonatype.plexus.build.incremental.BuildContext
The MavenBuildContext
that allows to link the build with the IDEprotected org.springframework.context.annotation.AnnotationConfigApplicationContext
The 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.MavenProjectHelper
protected 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
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
-
Method Summary
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
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, getTargetSchemaSubFolder, isAddRelayConnections, isGenerateJacksonAnnotations, logCommonConfiguration, logConfiguration
-
Field Details
-
buildContext
@Component protected org.sonatype.plexus.build.incremental.BuildContext buildContextThe MavenBuildContext
that 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:
getEnumPrefix
in interfaceCommonConfiguration
-
getEnumSuffix
- Specified by:
getEnumSuffix
in interfaceCommonConfiguration
-
getInputPrefix
- Specified by:
getInputPrefix
in interfaceCommonConfiguration
-
getInputSuffix
- Specified by:
getInputSuffix
in interfaceCommonConfiguration
-
getInterfacePrefix
- Specified by:
getInterfacePrefix
in interfaceCommonConfiguration
-
getInterfaceSuffix
- Specified by:
getInterfaceSuffix
in interfaceCommonConfiguration
-
getJsonGraphqlSchemaFilename
- Specified by:
getJsonGraphqlSchemaFilename
in interfaceCommonConfiguration
-
getMaxTokens
- Specified by:
getMaxTokens
in interfaceCommonConfiguration
-
getProjectDir
- Specified by:
getProjectDir
in interfaceCommonConfiguration
-
getSchemaFileFolder
- Specified by:
getSchemaFileFolder
in interfaceCommonConfiguration
-
getSchemaFilePattern
- Specified by:
getSchemaFilePattern
in interfaceCommonConfiguration
-
getTemplates
- Specified by:
getTemplates
in interfaceCommonConfiguration
-
getTypePrefix
- Specified by:
getTypePrefix
in interfaceCommonConfiguration
-
getTypeSuffix
- Specified by:
getTypeSuffix
in interfaceCommonConfiguration
-
getUnionPrefix
- Specified by:
getUnionPrefix
in interfaceCommonConfiguration
-
getUnionSuffix
- Specified by:
getUnionSuffix
in interfaceCommonConfiguration
-
isSkipGenerationIfSchemaHasNotChanged
public boolean isSkipGenerationIfSchemaHasNotChanged()- Specified by:
isSkipGenerationIfSchemaHasNotChanged
in interfaceCommonConfiguration
-
execute
public final void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Specified by:
execute
in interfaceorg.apache.maven.plugin.Mojo
- Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
-
executePostExecutionTask
- Throws:
IOException
-