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
Fields Modifier and Type Field Description protected File
classesDirectory
protected File
resourcesOutputDir
protected File
sourcesOutputDir
static org.jboss.jandex.DotName
XML_ROOT_ELEMENT
static org.jboss.jandex.DotName
XML_TYPE
-
Fields inherited from class org.apache.camel.maven.packaging.AbstractGeneratorMojo
buildContext, GENERATED_MSG, NL, project, projectHelper
-
-
Constructor Summary
Constructors Constructor Description SchemaGeneratorMojo()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
execute()
protected void
findClassProperties(Set<org.apache.camel.tooling.model.EipModel.EipOptionModel> eipOptions, Class<?> originalClassType, Class<?> classElement, String prefix, String modelName)
protected org.apache.camel.tooling.model.EipModel
findEipModelProperties(Class<?> classElement, String name)
static String
getPrimitiveType(String name)
Gets the JSON schema primitive type.static String
getType(String type, boolean enumType, boolean isDuration)
Gets the JSON schema type.-
Methods inherited from class org.apache.camel.maven.packaging.AbstractGeneratorMojo
addResourceDirectory, cache, createProperties, createProperties, execute, getProjectClassLoader, haveResourcesChanged, loadClass, refresh, refresh, updateResource, updateResource
-
-
-
-
Field Detail
-
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
@Parameter(defaultValue="${project.build.outputDirectory}") protected File classesDirectory
-
sourcesOutputDir
@Parameter(defaultValue="${project.basedir}/src/generated/java") protected File sourcesOutputDir
-
resourcesOutputDir
@Parameter(defaultValue="${project.basedir}/src/generated/resources") protected File resourcesOutputDir
-
-
Method Detail
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
- Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
-
findEipModelProperties
protected org.apache.camel.tooling.model.EipModel findEipModelProperties(Class<?> classElement, String name)
-
findClassProperties
protected void findClassProperties(Set<org.apache.camel.tooling.model.EipModel.EipOptionModel> eipOptions, Class<?> originalClassType, Class<?> classElement, String prefix, String modelName)
-
getType
public static String getType(String type, boolean enumType, boolean isDuration)
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
-
-