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 theexecute()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
Fields Modifier and Type Field Description protected org.sonatype.plexus.build.incremental.BuildContextbuildContextThe MavenBuildContextthat allows to link the build with the IDEprotected org.springframework.context.annotation.AnnotationConfigApplicationContextctxThe Spring context used for the plugin execution.java.lang.StringenumPrefixAn optional prefix to add to the classnames of the generated java classes for GraphQL enums.java.lang.StringenumSuffixAn optional suffix to add to the classnames of the generated java classes for GraphQL enums.java.lang.StringinputPrefixAn optional prefix to add to the classnames of the generated java classes for GraphQL input objects.java.lang.StringinputSuffixAn optional suffix to add to the classnames of the generated java classes for GraphQL input objects.java.lang.StringinterfacePrefixAn optional prefix to add to the classnames of the generated java classes for GraphQL interfaces.java.lang.StringinterfaceSuffixAn optional suffix to add to the classnames of the generated java classes for GraphQL interfaces.java.lang.IntegermaxTokens(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.MavenProjectHelperprojectHelperprotected java.lang.Class<?>springConfigurationClassThis class contains the Spring configuration for the actual instance of this Mojo.java.lang.StringtypePrefixAn optional prefix to add to the classnames of the generated java classes for GraphQL types.java.lang.StringtypeSuffixAn optional suffix to add to the classnames of the generated java classes for GraphQL types.java.lang.StringunionPrefixAn optional prefix to add to the classnames of the generated java classes for GraphQL unions.java.lang.StringunionSuffixAn 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_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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecute()protected voidexecutePostExecutionTask()java.lang.StringgetEnumPrefix()java.lang.StringgetEnumSuffix()java.lang.StringgetInputPrefix()java.lang.StringgetInputSuffix()java.lang.StringgetInterfacePrefix()java.lang.StringgetInterfaceSuffix()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()java.lang.StringgetTypeSuffix()java.lang.StringgetUnionPrefix()java.lang.StringgetUnionSuffix()booleanisSkipGenerationIfSchemaHasNotChanged()-
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, isAddRelayConnections, isGenerateJacksonAnnotations, logCommonConfiguration, logConfiguration
-
-
-
-
Field Detail
-
buildContext
@Component protected org.sonatype.plexus.build.incremental.BuildContext buildContext
The 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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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.)
-
maxTokens
@Parameter(property="com.graphql_java_generator.mavenplugin.maxTokens", defaultValue="2147483647") public java.lang.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 java.lang.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 java.lang.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 java.lang.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
protected final java.lang.Class<?> 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 ctx
The Spring context used for the plugin execution. It contains all the beans that runs for its execution
-
-
Method Detail
-
getEnumPrefix
public java.lang.String getEnumPrefix()
- Specified by:
getEnumPrefixin interfaceCommonConfiguration
-
getEnumSuffix
public java.lang.String getEnumSuffix()
- Specified by:
getEnumSuffixin interfaceCommonConfiguration
-
getInputPrefix
public java.lang.String getInputPrefix()
- Specified by:
getInputPrefixin interfaceCommonConfiguration
-
getInputSuffix
public java.lang.String getInputSuffix()
- Specified by:
getInputSuffixin interfaceCommonConfiguration
-
getInterfacePrefix
public java.lang.String getInterfacePrefix()
- Specified by:
getInterfacePrefixin interfaceCommonConfiguration
-
getInterfaceSuffix
public java.lang.String getInterfaceSuffix()
- Specified by:
getInterfaceSuffixin interfaceCommonConfiguration
-
getMaxTokens
public java.lang.Integer getMaxTokens()
- Specified by:
getMaxTokensin interfaceCommonConfiguration
-
getProjectDir
public java.io.File getProjectDir()
- Specified by:
getProjectDirin interfaceCommonConfiguration
-
getSchemaFileFolder
public java.io.File getSchemaFileFolder()
- Specified by:
getSchemaFileFolderin interfaceCommonConfiguration
-
getSchemaFilePattern
public java.lang.String getSchemaFilePattern()
- Specified by:
getSchemaFilePatternin interfaceCommonConfiguration
-
getTemplates
public java.util.Map<java.lang.String,java.lang.String> getTemplates()
- Specified by:
getTemplatesin interfaceCommonConfiguration
-
getTypePrefix
public java.lang.String getTypePrefix()
- Specified by:
getTypePrefixin interfaceCommonConfiguration
-
getTypeSuffix
public java.lang.String getTypeSuffix()
- Specified by:
getTypeSuffixin interfaceCommonConfiguration
-
getUnionPrefix
public java.lang.String getUnionPrefix()
- Specified by:
getUnionPrefixin interfaceCommonConfiguration
-
getUnionSuffix
public java.lang.String 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
protected void executePostExecutionTask() throws java.io.IOException- Throws:
java.io.IOException
-
-