Package org.apache.camel.maven
Class AbstractGeneratorMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.apache.camel.maven.AbstractGeneratorMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
AbstractSourceGeneratorMojo
public abstract class AbstractGeneratorMojo extends org.apache.maven.plugin.AbstractMojo
Base class for API based generation MOJOs.
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
COMPONENT_PACKAGE
protected String
componentName
protected String
componentPackage
protected org.slf4j.Logger
log
protected static String
OUT_PACKAGE
protected String
outPackage
protected static String
PREFIX
protected org.apache.maven.project.MavenProject
project
protected String
scheme
-
Constructor Summary
Constructors Constructor Description AbstractGeneratorMojo()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
execute()
protected abstract void
executeInternal()
Template Method which assumesprojectClassLoader
is set.static String
getCanonicalName(Class<?> type)
protected static org.apache.velocity.app.VelocityEngine
getEngine()
protected ClassLoader
getProjectClassLoader()
protected void
mergeTemplate(org.apache.velocity.VelocityContext context, File outFile, String templateName)
static void
refresh(org.sonatype.plexus.build.incremental.BuildContext buildContext, Path file)
protected void
setProjectClassLoader(ClassLoader projectClassLoader)
static void
updateResource(org.sonatype.plexus.build.incremental.BuildContext buildContext, Path out, String data)
-
-
-
Field Detail
-
PREFIX
protected static final String PREFIX
- See Also:
- Constant Field Values
-
OUT_PACKAGE
protected static final String OUT_PACKAGE
- See Also:
- Constant Field Values
-
COMPONENT_PACKAGE
protected static final String COMPONENT_PACKAGE
- See Also:
- Constant Field Values
-
log
protected final org.slf4j.Logger log
-
outPackage
@Parameter(defaultValue="org.apache.camel.component.internal") protected String outPackage
-
scheme
@Parameter(required=true, property="org.apache.camel.scheme") protected String scheme
-
componentName
@Parameter(required=true, property="org.apache.camel.componentName") protected String componentName
-
componentPackage
@Parameter(required=true, defaultValue="org.apache.camel.component") protected String componentPackage
-
project
@Parameter(required=true, defaultValue="${project}", readonly=true) protected org.apache.maven.project.MavenProject project
-
-
Method Detail
-
getEngine
protected static org.apache.velocity.app.VelocityEngine getEngine() throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
execute
public final void execute() throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
executeInternal
protected abstract void executeInternal() throws Exception
Template Method which assumesprojectClassLoader
is set.- Throws:
Exception
-
getProjectClassLoader
protected ClassLoader getProjectClassLoader()
-
setProjectClassLoader
protected void setProjectClassLoader(ClassLoader projectClassLoader)
-
mergeTemplate
protected void mergeTemplate(org.apache.velocity.VelocityContext context, File outFile, String templateName) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
updateResource
public static void updateResource(org.sonatype.plexus.build.incremental.BuildContext buildContext, Path out, String data)
-
refresh
public static void refresh(org.sonatype.plexus.build.incremental.BuildContext buildContext, Path file)
-
-