public abstract class AbstractSchemaMojo extends AbstractMojo
| Modifier and Type | Field and Description |
|---|---|
protected String[] |
classes
Specifies the names of specific Java classes to search for @
JSimpleClass or @JFieldType annotations. |
protected String[] |
packages
Specifies Java package names under which to search for classes with @
JSimpleClass or @JFieldType annotations. |
protected MavenProject |
project |
protected String |
storageIdGeneratorClass
The
StorageIdGenerator to use for generating JSimpleDB storage ID's. |
| Constructor and Description |
|---|
AbstractSchemaMojo() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
addDependencyClasspathElements(List<String> elements) |
void |
execute() |
protected abstract void |
execute(JSimpleDB jdb) |
protected void |
generate(SchemaModel schema,
File file)
Generate schema XML file, overwriting any previous file.
|
protected abstract File |
getClassOutputDirectory() |
protected boolean |
verify(JSimpleDB jdb,
Iterator<? extends File> otherVersionFiles)
Check schema for hard conflicts with other schema versions defined by an interation of XML files.
|
protected boolean |
verify(SchemaModel schema,
File file,
boolean matchNames)
Verify that the provided schema matches the schema defined by the specified XML file.
|
getLog, getPluginContext, setLog, setPluginContext@Parameter protected String[] packages
JSimpleClass or @JFieldType annotations.
If no <classes> or <packages> are configured, then by default this plugin
searches all classes in the output directory.
@Parameter protected String[] classes
JSimpleClass or @JFieldType annotations.
If no <classes> or <packages> are configured, then by default this plugin
searches all classes in the output directory.
@Parameter protected String storageIdGeneratorClass
The StorageIdGenerator to use for generating JSimpleDB storage ID's.
By default, a DefaultStorageIdGenerator is used.
To configure a custom StorageIdGenerator, specify its class name like this:
<configuration>
<storageIdGeneratorClass>com.example.MyStorageIdGenerator</storageIdGeneratorClass>
...
</configuration>
The specified class (com.example.MyStorageIdGenerator in this example) must be available either
as part of the project being built or in one of the project's dependencies.@Parameter(defaultValue="${project}", readonly=true) protected MavenProject project
protected abstract File getClassOutputDirectory()
protected abstract void addDependencyClasspathElements(List<String> elements) throws DependencyResolutionRequiredException
protected abstract void execute(JSimpleDB jdb) throws MojoExecutionException, MojoFailureException
public final void execute()
throws MojoExecutionException,
MojoFailureException
protected void generate(SchemaModel schema, File file) throws MojoExecutionException
schema - database schemafile - schema XML output fileMojoExecutionException - if an unexpected error occursprotected boolean verify(SchemaModel schema, File file, boolean matchNames) throws MojoExecutionException
schema - actual schemafile - expected schema XML filematchNames - whether names must match, or only storage ID'sMojoExecutionException - if an unexpected error occursprotected boolean verify(JSimpleDB jdb, Iterator<? extends File> otherVersionFiles) throws MojoExecutionException
jdb - database instanceotherVersionFiles - iteration of other schema version XML filesMojoExecutionException - if an unexpected error occursCopyright © 2016. All rights reserved.