Class MarshallerSourceCodeGenerator
java.lang.Object
org.infinispan.protostream.annotations.impl.AbstractMarshallerCodeGenerator
org.infinispan.protostream.annotations.impl.processor.MarshallerSourceCodeGenerator
Generates source code for the marshaller.
- Since:
- 4.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate final GeneratedFilesWriterprivate static final LogFields inherited from class AbstractMarshallerCodeGenerator
ADAPTER_FIELD_NAME -
Constructor Summary
ConstructorsConstructorDescriptionMarshallerSourceCodeGenerator(GeneratedFilesWriter generatedFilesWriter, XTypeFactory typeFactory, String protobufSchemaPackage) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddAdapterField(IndentWriter iw, ProtoMessageTypeMetadata messageTypeMetadata) private voidaddFileHeader(IndentWriter iw, String className) private voidaddMarshallerDelegateField(IndentWriter iw, ProtoFieldMetadata fieldMetadata, Set<String> addedFields) private voidaddMarshallerDelegateFields(IndentWriter iw, ProtoMessageTypeMetadata messageTypeMetadata) Add fields used to cache delegates to other marshalled types (message or enum).private voidemitSource(String fqn, String source, ProtoTypeMetadata ptm) private voidvoidgenerateMarshaller(SerializationContext serCtx, ProtoTypeMetadata ptm) private voidprivate static StringhashStrings(String... strings) Computes the SHA-256 hash over the input strings and returns the resulting digest encoded as a base 16 integer from which all leading zeroes are stripped down.private String
-
Field Details
-
log
-
DIGEST_ALG
- See Also:
-
generatedFilesWriter
-
generatedClasses
-
-
Constructor Details
-
MarshallerSourceCodeGenerator
MarshallerSourceCodeGenerator(GeneratedFilesWriter generatedFilesWriter, XTypeFactory typeFactory, String protobufSchemaPackage)
-
-
Method Details
-
generateMarshaller
public void generateMarshaller(SerializationContext serCtx, ProtoTypeMetadata ptm) throws IOException - Specified by:
generateMarshallerin classAbstractMarshallerCodeGenerator- Throws:
IOException
-
makeUniqueMarshallerClassName
-
hashStrings
-
generateEnumMarshaller
- Throws:
IOException
-
addFileHeader
-
generateMessageMarshaller
- Throws:
IOException
-
addAdapterField
-
addMarshallerDelegateFields
private void addMarshallerDelegateFields(IndentWriter iw, ProtoMessageTypeMetadata messageTypeMetadata) Add fields used to cache delegates to other marshalled types (message or enum). These fields are lazily initialized. -
addMarshallerDelegateField
private void addMarshallerDelegateField(IndentWriter iw, ProtoFieldMetadata fieldMetadata, Set<String> addedFields) -
emitSource
- Throws:
IOException
-
getGeneratedClasses
-