Class 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 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
    • Constructor Detail

      • SchemaGeneratorMojo

        public SchemaGeneratorMojo()
    • 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
      • 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