Package org.infinispan.protostream
Interface GeneratedSchema
-
- All Superinterfaces:
SerializationContextInitializer
public interface GeneratedSchema extends SerializationContextInitializer
An annotation-based generated proto schema file. This is just a more specific flavour ofSerializationContextInitializer
that also exposes the generated Protobuf schema, which consists of the file name and the file contents. Users will never implement this interface directly. Implementations are always generated by the annotation processor based on theAutoProtoSchemaBuilder
annotation, identically as forSerializationContextInitializer
.- Since:
- 4.3.4
- Author:
- [email protected]
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description String
getProtoFile()
Returns the contents of the proto file as aString
.String
getProtoFileName()
Returns the name of the proto file.default Reader
getProtoFileReader()
Convenience method to obtain aReader
of the schema file contents.-
Methods inherited from interface org.infinispan.protostream.SerializationContextInitializer
registerMarshallers, registerSchema
-
-
-
-
Method Detail
-
getProtoFileName
String getProtoFileName()
Returns the name of the proto file. The name is allowed to contain slashes so it can look like an absolute or relative path. The returned value must be the same (equals) on each invocation.- Specified by:
getProtoFileName
in interfaceSerializationContextInitializer
-
getProtoFile
String getProtoFile() throws UncheckedIOException
Returns the contents of the proto file as aString
. The returned value must be guaranteed to be the same (equals) on each invocation. Implementations can return a constant or a value stored in memory but they are generally free to also retrieve it from somewhere else, including the classpath, the disk, or even a mechanism that can potentially fail with anUncheckedIOException
.- Specified by:
getProtoFile
in interfaceSerializationContextInitializer
- Throws:
UncheckedIOException
- if the file contents cannot be retrieved
-
getProtoFileReader
default Reader getProtoFileReader() throws UncheckedIOException
Convenience method to obtain aReader
of the schema file contents. The caller is responsible for closing theReader
once done with it.- Throws:
UncheckedIOException
- if the file contents cannot be retrieved
-
-