Class GenerateSchemaMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- gov.nist.secauto.metaschema.maven.plugin.AbstractMetaschemaMojo
-
- gov.nist.secauto.metaschema.maven.plugin.GenerateSchemaMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="generate-schemas", defaultPhase=GENERATE_RESOURCES) public class GenerateSchemaMojo extends AbstractMetaschemaMojoGoal which generates Java source files for a given set of Module definitions.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGenerateSchemaMojo.SchemaFormat
-
Field Summary
-
Fields inherited from class gov.nist.secauto.metaschema.maven.plugin.AbstractMetaschemaMojo
excludes, includes, staleFileDirectory
-
-
Constructor Summary
Constructors Constructor Description GenerateSchemaMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecute()protected voidgenerate(Set<IModule> modules)Performs schema generation using the provided Metaschema modules.protected StringgetStaleFileName()Gets the last part of the stale filename.protected booleanisInlineChoiceDefinitions()Determine if inlining choice definitions is required.protected booleanisInlineDefinitions()Determine if inlining definitions is required.-
Methods inherited from class gov.nist.secauto.metaschema.maven.plugin.AbstractMetaschemaMojo
getBuildContext, getEncoding, getMavenProject, getMojoExecution, getOutputDirectory, getSources, getStaleFile, isGenerationRequired, setOutputDirectory, shouldExecutionBeSkipped
-
-
-
-
Constructor Detail
-
GenerateSchemaMojo
public GenerateSchemaMojo()
-
-
Method Detail
-
isInlineDefinitions
protected boolean isInlineDefinitions()
Determine if inlining definitions is required.- Returns:
trueif inlining definitions is required, orfalseotherwise
-
isInlineChoiceDefinitions
protected boolean isInlineChoiceDefinitions()
Determine if inlining choice definitions is required.- Returns:
trueif inlining choice definitions is required, orfalseotherwise
-
getStaleFileName
protected String getStaleFileName()
Gets the last part of the stale filename.
The full stale filename will be generated by pre-pending
"." + getExecution().getExecutionId()to this staleFileName.- Specified by:
getStaleFileNamein classAbstractMetaschemaMojo- Returns:
- the stale filename postfix
-
generate
protected void generate(@NonNull Set<IModule> modules) throws org.apache.maven.plugin.MojoExecutionException
Performs schema generation using the provided Metaschema modules.- Parameters:
modules- the Metaschema modules to generate the schema for- Throws:
org.apache.maven.plugin.MojoExecutionException- if an error occurred during generation
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
-