public abstract class BaseProtoSchemaGenerator extends Object
This class is not to be directly invoked by users. See ProtoSchemaBuilder
instead.
Generators are not expected to be stateless, so reuse must be done taking this into account.
Modifier and Type | Field and Description |
---|---|
protected boolean |
autoImportClasses
Indicates if class dependencies are automatically added when discovered or will generate an error.
|
protected Set<XClass> |
classes
Initial set of classes.
|
protected String |
fileName
Protobuf schema file name.
|
static boolean |
generateMarshallerDebugComments
Set this flag to
true to enable output of debug comments in the generated marshaller source code. |
static boolean |
generateSchemaDebugComments
Set this flag to
true to enable output of debug comments in the generated Protobuf schema. |
protected String |
generator |
protected String |
packageName
Protobuf schema package name.
|
protected SerializationContext |
serializationContext |
protected UnifiedTypeFactory |
typeFactory |
Modifier | Constructor and Description |
---|---|
protected |
BaseProtoSchemaGenerator(UnifiedTypeFactory typeFactory,
SerializationContext serializationContext,
String generator,
String fileName,
String packageName,
Set<XClass> classes,
boolean autoImportClasses) |
Modifier and Type | Method and Description |
---|---|
String |
generateAndRegister() |
Set<XClass> |
getMarshalledClasses() |
protected abstract ProtoTypeMetadata |
importProtoTypeMetadata(XClass javaType)
Return an imported ProtoTypeMetadata implementation or null if it cannot be imported.
|
protected boolean |
isUnknownClass(XClass c) |
protected abstract AbstractMarshallerCodeGenerator |
makeCodeGenerator()
Creates a code generator for marshallers.
|
protected ProtoTypeMetadata |
makeProtoTypeMetadata(XClass javaType) |
protected ProtoTypeMetadata |
scanAnnotations(XClass javaType) |
public static boolean generateSchemaDebugComments
true
to enable output of debug comments in the generated Protobuf schema.public static boolean generateMarshallerDebugComments
true
to enable output of debug comments in the generated marshaller source code.protected final UnifiedTypeFactory typeFactory
protected final SerializationContext serializationContext
protected final String fileName
protected final String generator
protected final String packageName
protected final boolean autoImportClasses
protected BaseProtoSchemaGenerator(UnifiedTypeFactory typeFactory, SerializationContext serializationContext, String generator, String fileName, String packageName, Set<XClass> classes, boolean autoImportClasses)
public String generateAndRegister() throws ProtoSchemaBuilderException
ProtoSchemaBuilderException
protected abstract AbstractMarshallerCodeGenerator makeCodeGenerator()
protected ProtoTypeMetadata scanAnnotations(XClass javaType)
protected abstract ProtoTypeMetadata importProtoTypeMetadata(XClass javaType)
protected ProtoTypeMetadata makeProtoTypeMetadata(XClass javaType)
protected boolean isUnknownClass(XClass c)
Copyright © 2019 JBoss, a division of Red Hat. All rights reserved.