Package com.carrotsearch.hppc.generator
Class TemplateProcessorMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
com.carrotsearch.hppc.generator.TemplateProcessorMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="template-processor",
defaultPhase=GENERATE_SOURCES,
threadSafe=true,
requiresProject=true)
public class TemplateProcessorMojo
extends org.apache.maven.plugin.AbstractMojo
Maven mojo applying preprocessor templates.
-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanprivate final HashMap<String, IntrinsicMethod> private Pathprivate org.apache.maven.project.MavenProjectprivate Pathprivate com.google.common.base.Stopwatchprivate com.google.common.base.Stopwatchprivate com.google.common.base.Stopwatchprivate com.google.common.base.Stopwatchprivate org.apache.velocity.runtime.RuntimeInstancebooleanFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate List<TemplateFile> collectTemplateFiles(Path dir) Collect all template files from this and subdirectories.voidexecute()private voidexecute0()private StringfilterComments(String input) private StringfilterIntrinsics(String input, TemplateOptions templateOptions) private StringfilterStaticTokens(String template, TemplateOptions templateOptions) private StringfilterTypeClassRefs(String input, TemplateOptions options) private StringfilterVelocity(TemplateFile f, String template, TemplateOptions options) Apply velocity to the input.private voidgenerate(TemplateFile input, List<OutputFile> outputs, TemplateOptions templateOptions) Apply templates.private List<OutputFile> processTemplates(List<TemplateFile> inputs) Apply templates to.ktypefiles (single-argument).removeOtherFiles(Path outputPath, List<OutputFile> keep) scanFilesMatching(Path dir, String matchPattern) private StringtargetFileName(String relativePath, TemplateOptions templateOptions) private voidverboseLog(String message) Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
intrinsics
-
project
@Parameter(property="project", readonly=true, required=true) private org.apache.maven.project.MavenProject project -
verbose
@Parameter(defaultValue="false") public boolean verbose -
incremental
@Parameter(property="template.processor.incremental", defaultValue="true") public boolean incremental -
attachSources
-
templatesDir
-
outputDir
-
velocity
private org.apache.velocity.runtime.RuntimeInstance velocity -
templatesPath
-
outputPath
-
timeVelocity
private com.google.common.base.Stopwatch timeVelocity -
timeIntrinsics
private com.google.common.base.Stopwatch timeIntrinsics -
timeTypeClassRefs
private com.google.common.base.Stopwatch timeTypeClassRefs -
timeComments
private com.google.common.base.Stopwatch timeComments
-
-
Constructor Details
-
TemplateProcessorMojo
public TemplateProcessorMojo()
-
-
Method Details
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
execute0
- Throws:
IOExceptionorg.apache.maven.plugin.MojoExecutionException
-
removeOtherFiles
- Throws:
IOException
-
verboseLog
-
processTemplates
Apply templates to.ktypefiles (single-argument).- Throws:
IOException
-
generate
private void generate(TemplateFile input, List<OutputFile> outputs, TemplateOptions templateOptions) throws IOException Apply templates.- Throws:
IOException
-
filterStaticTokens
-
filterIntrinsics
-
filterComments
-
filterTypeClassRefs
-
filterVelocity
Apply velocity to the input. -
targetFileName
-
scanFilesMatching
- Throws:
IOException
-
collectTemplateFiles
Collect all template files from this and subdirectories.- Throws:
IOException
-