@Mojo(name="example-to-model",
defaultPhase=GENERATE_SOURCES)
public class ExampleToModelMojo
extends org.apache.maven.plugin.AbstractMojo
Modifier and Type | Class and Description |
---|---|
private static interface |
ExampleToModelMojo.Visitor |
Modifier and Type | Field and Description |
---|---|
protected boolean |
attach |
private static List<Character> |
FORBIDDEN_JAVA_NAMES |
protected String |
header |
protected String |
packageBase |
protected org.apache.maven.project.MavenProject |
project |
protected File |
source |
protected File |
target |
Constructor and Description |
---|
ExampleToModelMojo() |
Modifier and Type | Method and Description |
---|---|
private String |
buildArrayType(int arrayLevel,
String type) |
private String |
buildValidFieldName(String jsonField) |
void |
execute() |
private void |
fieldGetSetMethods(Writer writer,
String jsonField,
String field,
String type,
String prefix,
int arrayLevel,
Collection<String> imports) |
private void |
generate(javax.json.JsonReaderFactory readerFactory,
File source,
Writer writer,
String javaName) |
private void |
generateFieldsAndMethods(Writer writer,
javax.json.JsonObject object,
String prefix,
Collection<String> imports) |
private void |
generateFile(javax.json.JsonReaderFactory readerFactory,
File source) |
private void |
handleArray(Writer writer,
String prefix,
Map<String,javax.json.JsonObject> nestedTypes,
javax.json.JsonValue value,
String jsonField,
String fieldName,
int arrayLevel,
Collection<String> imports) |
private String |
toJavaFieldName(String key) |
private String |
toJavaName(String file) |
private void |
visit(javax.json.JsonStructure structure,
ExampleToModelMojo.Visitor visitor) |
@Parameter(property="johnzon.source", defaultValue="${project.basedir}/src/main/johnzon") protected File source
@Parameter(property="johnzon.target", defaultValue="${project.build.directory}/generated-sources/johnzon") protected File target
@Parameter(property="johnzon.package", defaultValue="com.johnzon.generated") protected String packageBase
@Parameter protected String header
@Parameter protected org.apache.maven.project.MavenProject project
@Parameter(property="johnzon.attach", defaultValue="true") protected boolean attach
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
private void generate(javax.json.JsonReaderFactory readerFactory, File source, Writer writer, String javaName) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
private void generateFieldsAndMethods(Writer writer, javax.json.JsonObject object, String prefix, Collection<String> imports) throws IOException
IOException
private void handleArray(Writer writer, String prefix, Map<String,javax.json.JsonObject> nestedTypes, javax.json.JsonValue value, String jsonField, String fieldName, int arrayLevel, Collection<String> imports) throws IOException
IOException
private void fieldGetSetMethods(Writer writer, String jsonField, String field, String type, String prefix, int arrayLevel, Collection<String> imports) throws IOException
IOException
private void visit(javax.json.JsonStructure structure, ExampleToModelMojo.Visitor visitor)
private void generateFile(javax.json.JsonReaderFactory readerFactory, File source) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.