Trail:

Type Mapping

Each generator defines a set of typemappings for the most common Java types to the corresponding types in the target language. Nevertheless there are situations where those predefined typemappings are not sufficient or appropriate. Hence you can overwrite existing and pass additional type mappings via the command line.

Type Based Type Mapping

Type based mappings map a given Java input type to the specified type in the target language:

-map java.lang.Long:Number

Generic Java types will be automatically transformed into generic output types if the target language supports that (e.g. C#). If you want to map generic Java types to non-generic target types you have to append an empty <> to that type:

-map java.lang.Class:System.Type<>

It is also possible to completely omit a specific type from code generation by mapping it to the target type null:

-map java.io.Serializable:null

Annotation Based Type Mapping

Annotation based type mappings precede type based mappings and let you define a target type for methods and properties annotated with a specific annotation:

-genericmap org.fluffnstuff.annotations.SerializeById:Number