class JavaGenerator
Generates Java source code that matches proto definitions.
This can map type names from protocol buffers (like uint32, string, or squareup.protos.person.Person to the corresponding Java names (like int, java.lang.String, or com.squareup.protos.person.Person).
fun abstractAdapterName(protoType: ProtoType): ClassName?
Returns the Java type of the abstract adapter class generated for a corresponding |
|
fun generateAdapterForCustomType(type: Type): TypeSpec
Returns a standalone adapter for |
|
fun generateEnum(type: EnumType): TypeSpec |
|
fun generateMessage(type: MessageType): TypeSpec |
|
fun generateOptionType(extend: Extend, field: Field): TypeSpec? |
|
fun generateType(type: Type): TypeSpec
Returns the generated code for |
|
fun generatedTypeName(type: Type): ClassName
Returns the full name of the class generated for fun generatedTypeName(field: Field): ClassName
Returns the full name of the class generated for |
|
static fun get(schema: Schema): JavaGenerator |
|
fun isEnum(type: ProtoType): Boolean |
|
fun schema(): Schema |
|
fun typeName(protoType: ProtoType): TypeName
Returns the Java type for |
|
fun withAndroid(emitAndroid: Boolean): JavaGenerator |
|
fun withAndroidAnnotations(emitAndroidAnnotations: Boolean): JavaGenerator |
|
fun withCompact(emitCompact: Boolean): JavaGenerator |
|
fun withOptions(emitDeclaredOptions: Boolean, emitAppliedOptions: Boolean): JavaGenerator |
|
fun withProfile(profile: Profile): JavaGenerator |