Class BaseProtoSchemaGenerator
java.lang.Object
org.infinispan.protostream.annotations.impl.BaseProtoSchemaGenerator
Generates a protobuf schema (proto file) based on annotations and also generates marshallers for the types.
This class is not to be directly invoked by users.
Generators are not expected to be stateless, so reuse must be done taking this into account.
- Since:
- 3.0
- Author:
- [email protected]
-
Field Summary
Modifier and TypeFieldDescriptionprotected final boolean
Indicates if class dependencies are automatically added when discovered or will generate an error.Initial set of classes.protected final String
Protobuf schema file name.static boolean
Set this flag totrue
to enable output of debug comments in the generated marshaller source code.static boolean
Set this flag totrue
to enable output of debug comments in the generated Protobuf schema.protected final String
protected final String
Protobuf schema package name.protected final SerializationContext
protected final XTypeFactory
-
Constructor Summary
ModifierConstructorDescriptionprotected
BaseProtoSchemaGenerator
(XTypeFactory typeFactory, SerializationContext serializationContext, String generator, String fileName, String packageName, Set<XClass> classes, boolean autoImportClasses, ProtoSyntax syntax) -
Method Summary
Modifier and TypeMethodDescriptionprotected XClass
getAdapterFor
(XClass annotatedClass) protected XClass
getTargetClass
(XClass annotatedClass) Get the marshalled class or enum.protected abstract ProtoTypeMetadata
importProtoTypeMetadata
(XClass javaType) Return an imported ProtoTypeMetadata implementation or null if it cannot be imported.protected boolean
protected ProtoTypeMetadata
makeEnumTypeMetadata
(XClass javaType) protected abstract AbstractMarshallerCodeGenerator
Creates a code generator for marshallers.protected ProtoTypeMetadata
makeMessageTypeMetadata
(XClass javaType) protected ProtoTypeMetadata
makeTypeMetadata
(XClass javaType) protected ProtoTypeMetadata
scanAnnotations
(XClass javaType) syntax()
-
Field Details
-
generateSchemaDebugComments
public static boolean generateSchemaDebugCommentsSet this flag totrue
to enable output of debug comments in the generated Protobuf schema. -
generateMarshallerDebugComments
public static boolean generateMarshallerDebugCommentsSet this flag totrue
to enable output of debug comments in the generated marshaller source code. -
typeFactory
-
serializationContext
-
fileName
Protobuf schema file name. -
generator
-
packageName
Protobuf schema package name. -
classes
Initial set of classes. -
autoImportClasses
protected final boolean autoImportClassesIndicates if class dependencies are automatically added when discovered or will generate an error.
-
-
Constructor Details
-
BaseProtoSchemaGenerator
protected BaseProtoSchemaGenerator(XTypeFactory typeFactory, SerializationContext serializationContext, String generator, String fileName, String packageName, Set<XClass> classes, boolean autoImportClasses, ProtoSyntax syntax)
-
-
Method Details
-
syntax
-
generateAndRegister
-
getMarshalledClasses
-
makeMarshallerCodeGenerator
Creates a code generator for marshallers. -
scanAnnotations
-
importProtoTypeMetadata
Return an imported ProtoTypeMetadata implementation or null if it cannot be imported. -
makeTypeMetadata
-
makeEnumTypeMetadata
-
makeMessageTypeMetadata
-
isUnknownClass
-
getAdapterFor
-
getTargetClass
Get the marshalled class or enum. The marshalled class and the annotated class are not always the same, depending on the presence of the ProtoAdapter annotation which may establish a new target.
-