Package org.apache.camel.maven.packaging
Class EndpointSchemaGeneratorMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.apache.camel.maven.packaging.AbstractGeneratorMojo
-
- org.apache.camel.maven.packaging.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 Summary
Fields Modifier and Type Field Description static org.jboss.jandex.DotName
API_PARAMS
protected File
classesDirectory
static org.jboss.jandex.DotName
COMPONENT
protected org.jboss.jandex.IndexView
indexView
protected Map<String,org.jboss.forge.roaster.model.source.JavaClassSource>
parsed
protected Map<String,String>
resources
protected File
resourcesOutputDir
protected List<Path>
sourceRoots
protected Map<String,String>
sources
protected File
sourcesOutputDir
static org.jboss.jandex.DotName
URI_ENDPOINT
-
Fields inherited from class org.apache.camel.maven.packaging.AbstractGeneratorMojo
buildContext, GENERATED_MSG, NL, project, projectHelper
-
-
Constructor Summary
Constructors Constructor Description EndpointSchemaGeneratorMojo()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
execute()
protected void
findClassProperties(org.apache.camel.tooling.model.ComponentModel componentModel, Class<?> classElement, Set<String> excludes, String prefix, String nestedTypeName, String nestedFieldName, boolean componentOption)
protected void
findComponentClassProperties(org.apache.camel.tooling.model.ComponentModel componentModel, Class<?> classElement, String prefix, String nestedTypeName, String nestedFieldName)
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)
protected void
generateMetaInfConfigurer(String name, String fqn)
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)
String
getDocumentationWithNotes(org.apache.camel.tooling.model.BaseOptionModel option)
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.protected boolean
updateResource(Path dir, String file, String data)
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)
-
Methods inherited from class org.apache.camel.maven.packaging.AbstractGeneratorMojo
addResourceDirectory, cache, createProperties, createProperties, execute, getProjectClassLoader, haveResourcesChanged, loadClass, refresh, refresh, updateResource
-
-
-
-
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
-
-
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)
-
updateResource
protected boolean updateResource(Path dir, String file, String data)
- Overrides:
updateResource
in classAbstractGeneratorMojo
-
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)
-
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
-
-