Package io.helidon.codegen.snakeyaml
Class SnakeYAMLMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- io.helidon.codegen.snakeyaml.SnakeYAMLMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="generate", requiresProject=true, defaultPhase=GENERATE_SOURCES, requiresDependencyResolution=RUNTIME) public class SnakeYAMLMojo extends org.apache.maven.plugin.AbstractMojoGoal which generates code to help with parsing YAML and JSON using SnakeYAML.SnakeYAML does a lot of work converting between JSON or YAML and bean classes, but it needs some help with information it cannot get from compiled class bytecode. This plug-in generates that helper code.
It analyzes Java sources in a specified location and generates a SnakeYAML
TypeDefinitionfor each class. It also uses a second location to locate implementations of interfaces from the first area for use in setting the impl classes in thoseTypeDefinitioninstances.Often, builds will use the maven dependency plug-in to extract sources into those two locations and then invoke the plug-in to analyze the code and generate the helper class.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSnakeYAMLMojo.CompilerConfigPrescribes how the plug-in finds Java classes to analyze for either the interfaces or the implementations.
-
Constructor Summary
Constructors Constructor Description SnakeYAMLMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecute()Runs the goal, analyzing interfaces and implementations and generating the helper class.voidsetImplementationsConfig(SnakeYAMLMojo.CompilerConfig config)Sets the compiler config for analyzing the implementations.voidsetInterfacesConfig(SnakeYAMLMojo.CompilerConfig config)Sets the compiler config for analyzing the interfaces.
-
-
-
Method Detail
-
setInterfacesConfig
public void setInterfacesConfig(SnakeYAMLMojo.CompilerConfig config)
Sets the compiler config for analyzing the interfaces.- Parameters:
config- CompilerConfig for analyzing interfaces
-
setImplementationsConfig
public void setImplementationsConfig(SnakeYAMLMojo.CompilerConfig config)
Sets the compiler config for analyzing the implementations.- Parameters:
config- CompilerConfig for analyzing implementations
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionExceptionRuns the goal, analyzing interfaces and implementations and generating the helper class.- Throws:
org.apache.maven.plugin.MojoExecutionException- in case of errors while executing the goal
-
-