use of org.infinispan.protostream.annotations.impl.ImportedProtoTypeMetadata in project protostream by infinispan.
the class CompileTimeProtoSchemaGenerator method importProtoTypeMetadata.
@Override
protected ProtoTypeMetadata importProtoTypeMetadata(XClass javaType) {
if (javaType == typeFactory.fromClass(WrappedMessage.class)) {
GenericDescriptor descriptor = serializationContext.getDescriptorByName(WrappedMessage.PROTOBUF_TYPE_NAME);
BaseMarshaller<WrappedMessage> marshaller = serializationContext.getMarshaller(WrappedMessage.PROTOBUF_TYPE_NAME);
return new ImportedProtoTypeMetadata(descriptor, marshaller, javaType);
}
String fileName = dependencies.get(javaType);
if (fileName != null) {
String packageName = serializationContext.getFileDescriptors().get(fileName).getPackage();
return new CompileTimeImportedProtoTypeMetadata(makeTypeMetadata(javaType), packageName, fileName);
}
return null;
}
Aggregations