Class EndpointSchemaGeneratorMojo

  • All Implemented Interfaces:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

    @Mojo(name="generate-endpoint-schema",
          threadSafe=true,
          requiresDependencyResolution=COMPILE_PLUS_RUNTIME,
          defaultPhase=PROCESS_CLASSES)
    public class EndpointSchemaGeneratorMojo
    extends AbstractGeneratorMojo
    • Field Detail

      • URI_ENDPOINT

        public static final org.jboss.jandex.DotName URI_ENDPOINT
      • COMPONENT

        public static final org.jboss.jandex.DotName COMPONENT
      • API_PARAMS

        public static final org.jboss.jandex.DotName API_PARAMS
      • 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
      • indexView

        protected org.jboss.jandex.IndexView indexView
      • sourceRoots

        protected List<Path> sourceRoots
      • parsed

        protected Map<String,​org.jboss.forge.roaster.model.source.JavaClassSource> parsed
    • Constructor Detail

      • EndpointSchemaGeneratorMojo

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

        protected org.apache.camel.tooling.model.ComponentModel writeJSonSchemeAndPropertyConfigurer​(Class<?> classElement,
                                                                                                     org.apache.camel.spi.UriEndpoint uriEndpoint,
                                                                                                     String title,
                                                                                                     String scheme,
                                                                                                     String extendsScheme,
                                                                                                     String label,
                                                                                                     String[] schemes,
                                                                                                     org.apache.camel.tooling.model.ComponentModel parentData)
      • getDocumentationWithNotes

        public String getDocumentationWithNotes​(org.apache.camel.tooling.model.BaseOptionModel option)
      • findComponentProperties

        protected org.apache.camel.tooling.model.ComponentModel findComponentProperties​(org.apache.camel.spi.UriEndpoint uriEndpoint,
                                                                                        Class<?> endpointClassElement,
                                                                                        String title,
                                                                                        String scheme,
                                                                                        String extendsScheme,
                                                                                        String label,
                                                                                        String[] schemes)
      • findComponentClassProperties

        protected void findComponentClassProperties​(org.apache.camel.tooling.model.ComponentModel componentModel,
                                                    Class<?> classElement,
                                                    String prefix,
                                                    String nestedTypeName,
                                                    String nestedFieldName)
      • findClassProperties

        protected void findClassProperties​(org.apache.camel.tooling.model.ComponentModel componentModel,
                                           Class<?> classElement,
                                           Set<String> excludes,
                                           String prefix,
                                           String nestedTypeName,
                                           String nestedFieldName,
                                           boolean componentOption)
      • generatePropertyConfigurer

        protected void generatePropertyConfigurer​(String pn,
                                                  String cn,
                                                  String fqn,
                                                  String en,
                                                  String pfqn,
                                                  String psn,
                                                  String scheme,
                                                  boolean hasSuper,
                                                  boolean component,
                                                  Collection<? extends org.apache.camel.tooling.model.BaseOptionModel> options,
                                                  org.apache.camel.tooling.model.ComponentModel model)
      • generateMetaInfConfigurer

        protected void generateMetaInfConfigurer​(String name,
                                                 String fqn)
      • 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