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 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

      @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
  • 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.MojoExecutionException
      org.apache.maven.plugin.MojoFailureException
    • findEipModelProperties

      protected org.apache.camel.tooling.model.EipModel findEipModelProperties(Class<?> classElement, String name)
    • findEipModelExchangeProperties

      protected void findEipModelExchangeProperties(Class<?> classElement, String name, org.apache.camel.tooling.model.EipModel eipModel)
    • 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
    • getPrimitiveType

      public static String getPrimitiveType(String name)
      Gets the JSON schema primitive type.
      Parameters:
      name - the java type
      Returns:
      the json schema primitive type, or null if not a primitive