Top Description Fields Constructors Methods
io.vertx.codegen

public abstract Class Generator<M extends Model>

extends Object
Class Inheritance
Known Direct Subclasses
io.vertx.codegen.generators.dataobjecthelper.DataObjectHelperGen
Type Parameters
<M>
the model
Imports
javax.annotation.processing.ProcessingEnvironment, java.lang.annotation.Annotation, java.util.Collection, .Collections, .Map, .Set

A generator for a Model.
Author
Julien Viet

Field Summary

Modifier and TypeField and Description
public ProcessingEnvironment
public boolean
public Set<String>
public String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Collection<Class<? extends Annotation>>
public String

Returns:

the filename or null if no generation should happen
filename
(M
the model
model
)

Generate the file name for the model.

public void
load(ProcessingEnvironment processingEnv)

public String

Returns:

the rendered string or null
render
(M
the model
model
,
int
the index for an incremental generator
index
,
int
the number of models for an incremental generator
size
,
Map<String, Object>
the session
session
)

Render the model

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

envback to summary
public ProcessingEnvironment env
incrementalback to summary
public boolean incremental
kindsback to summary
public Set<String> kinds
nameback to summary
public String name

Constructor Detail

Generatorback to summary
public Generator()

Method Detail

annotationsback to summary
public Collection<Class<? extends Annotation>> annotations()
filenameback to summary
public String filename(M model)

Generate the file name for the model.

When the returned value

  • is null, no file is created
  • does not contain / and ends with .java, the file is created as a source file by the annotation processor and the class will be compiled by the current compilation process
  • starts with the resources/ prefix, the file is created as a resource file by the annotation processor using the remaining suffix value and the file will likely end in the classes directory
  • otherwise the resource will be created as a file on the filesystem, a value not starting with / is created relative to the codegen.output directory
Parameters
model:M

the model

Returns:String

the filename or null if no generation should happen

loadback to summary
public void load(ProcessingEnvironment processingEnv)
renderback to summary
public String render(M model, int index, int size, Map<String, Object> session)

Render the model

Parameters
model:M

the model

index:int

the index for an incremental generator

size:int

the number of models for an incremental generator

session:Map<String, Object>

the session

Returns:String

the rendered string or null