Class FileDescriptor
- java.lang.Object
-
- org.infinispan.protostream.descriptors.FileDescriptor
-
public final class FileDescriptor extends Object
Representation of a .proto file, including its dependencies.- Since:
- 2.0
- Author:
- gustavonalle, [email protected]
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FileDescriptor.Builder
static class
FileDescriptor.Syntax
-
Field Summary
Fields Modifier and Type Field Description protected Configuration
configuration
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearErrors()
Clear resolving errors of unresolved files.Configuration
getConfiguration()
Map<String,FileDescriptor>
getDependants()
List<EnumDescriptor>
getEnumTypes()
Namespace
getExportedNamespace()
List<ExtendDescriptor>
getExtensionsTypes()
List<Descriptor>
getMessageTypes()
Top level message types defined in this file.String
getName()
Option
getOption(String name)
List<Option>
getOptions()
String
getPackage()
FileDescriptor.Syntax
getSyntax()
Map<String,GenericDescriptor>
getTypes()
All types defined in this file (both message and enum).boolean
isResolved()
void
markUnresolved()
void
resolveDependencies(ResolutionContext resolutionContext)
Resolve type references across files and report semantic errors like duplicate type declarations, duplicate type ids or clashing enum value constants.void
setConfiguration(Configuration configuration)
This method is not part of the public API.String
toString()
-
-
-
Field Detail
-
configuration
protected Configuration configuration
-
-
Method Detail
-
getConfiguration
public Configuration getConfiguration()
-
setConfiguration
public void setConfiguration(Configuration configuration)
This method is not part of the public API. May be removed in future versions.
-
getDependants
public Map<String,FileDescriptor> getDependants()
-
isResolved
public boolean isResolved()
-
markUnresolved
public void markUnresolved()
-
clearErrors
public void clearErrors()
Clear resolving errors of unresolved files. Parsing errors are not cleared. Transitions from ERROR status back to UNRESOLVED and propagates this recursively to all dependant FileDescriptors. All internal state acquired during type reference resolution is cleared for this file and dependants (recursively).
-
getExportedNamespace
public Namespace getExportedNamespace()
-
resolveDependencies
public void resolveDependencies(ResolutionContext resolutionContext) throws DescriptorParserException
Resolve type references across files and report semantic errors like duplicate type declarations, duplicate type ids or clashing enum value constants. OnlyFileDescriptor.Status.UNRESOLVED
files are processed. Files with other states are ignored.- Throws:
DescriptorParserException
-
getSyntax
public FileDescriptor.Syntax getSyntax()
-
getName
public String getName()
-
getPackage
public String getPackage()
-
getEnumTypes
public List<EnumDescriptor> getEnumTypes()
-
getMessageTypes
public List<Descriptor> getMessageTypes()
Top level message types defined in this file.
-
getExtensionsTypes
public List<ExtendDescriptor> getExtensionsTypes()
-
getTypes
public Map<String,GenericDescriptor> getTypes()
All types defined in this file (both message and enum).
-
-