Class SnakeYAMLMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
io.helidon.build.maven.snakeyaml.codegen.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.AbstractMojo
Goal 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
TypeDefinition for 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 those TypeDefinition instances.
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 ClassesModifier and TypeClassDescriptionstatic classPrescribes how the plug-in finds Java classes to analyze for either the interfaces or the implementations. -
Field Summary
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()Runs the goal, analyzing interfaces and implementations and generating the helper class.voidSets the compiler config for analyzing the implementations.voidSets the compiler config for analyzing the interfaces.Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Constructor Details
-
SnakeYAMLMojo
public SnakeYAMLMojo()
-
-
Method Details
-
setInterfacesConfig
Sets the compiler config for analyzing the interfaces.- Parameters:
config- CompilerConfig for analyzing interfaces
-
setImplementationsConfig
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
-