Package org.apache.camel.maven.packaging
Class SchemaGeneratorMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.apache.camel.maven.packaging.AbstractGeneratorMojo
org.apache.camel.maven.packaging.SchemaGeneratorMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="generate-schema",
threadSafe=true,
requiresDependencyResolution=COMPILE_PLUS_RUNTIME,
defaultPhase=PROCESS_CLASSES)
public class SchemaGeneratorMojo
extends AbstractGeneratorMojo
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Fileprotected Fileprotected Filestatic final org.jboss.jandex.DotNamestatic final org.jboss.jandex.DotNameFields inherited from class org.apache.camel.maven.packaging.AbstractGeneratorMojo
buildContext, GENERATED_MSG, NL, project, projectHelperFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
ConstructorsConstructorDescriptionSchemaGeneratorMojo(org.apache.maven.project.MavenProjectHelper projectHelper, org.codehaus.plexus.build.BuildContext buildContext) -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()protected voidfindClassProperties(Set<org.apache.camel.tooling.model.EipModel.EipOptionModel> eipOptions, Class<?> originalClassType, Class<?> classElement, String prefix, String modelName) protected voidfindEipModelExchangeProperties(Class<?> classElement, String name, org.apache.camel.tooling.model.EipModel eipModel) protected org.apache.camel.tooling.model.EipModelfindEipModelProperties(Class<?> classElement, String name) static StringgetPrimitiveType(String name) Gets the JSON schema primitive type.static StringGets the JSON schema type.Methods inherited from class org.apache.camel.maven.packaging.AbstractGeneratorMojo
addResourceDirectory, cache, canonicalClassName, createProperties, createProperties, execute, findConfigurations, format, getProjectClassLoader, haveResourcesChanged, isJsonFile, loadClass, newTreeSet, refresh, refresh, updateResource, updateResource, velocityMethods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
XML_ROOT_ELEMENT
public static final org.jboss.jandex.DotName XML_ROOT_ELEMENT -
XML_TYPE
public static final org.jboss.jandex.DotName XML_TYPE -
classesDirectory
-
sourcesOutputDir
-
resourcesOutputDir
@Parameter(defaultValue="${project.basedir}/src/generated/resources") protected File resourcesOutputDir
-
-
Constructor Details
-
SchemaGeneratorMojo
@Inject public SchemaGeneratorMojo(org.apache.maven.project.MavenProjectHelper projectHelper, org.codehaus.plexus.build.BuildContext buildContext)
-
-
Method Details
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
findEipModelProperties
-
findEipModelExchangeProperties
-
findClassProperties
-
getType
Gets the JSON schema type.- Parameters:
type- the java type- Returns:
- the json schema type, is never null, but returns object as the generic type
-
getPrimitiveType
Gets the JSON schema primitive type.- Parameters:
name- the java type- Returns:
- the json schema primitive type, or null if not a primitive
-