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, anistor@redhat.com
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFileDescriptor.Builderstatic classFileDescriptor.Syntax
-
Field Summary
Fields Modifier and Type Field Description protected Configurationconfiguration
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearErrors()Clear resolving errors of unresolved files.ConfigurationgetConfiguration()Map<String,FileDescriptor>getDependants()List<EnumDescriptor>getEnumTypes()NamespacegetExportedNamespace()List<ExtendDescriptor>getExtensionsTypes()List<Descriptor>getMessageTypes()Top level message types defined in this file.StringgetName()OptiongetOption(String name)List<Option>getOptions()StringgetPackage()FileDescriptor.SyntaxgetSyntax()Map<String,GenericDescriptor>getTypes()All types defined in this file (both message and enum).booleanisResolved()voidmarkUnresolved()voidresolveDependencies(ResolutionContext resolutionContext)Resolve type references across files and report semantic errors like duplicate type declarations, duplicate type ids or clashing enum value constants.voidsetConfiguration(Configuration configuration)This method is not part of the public API.StringtoString()
-
-
-
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.UNRESOLVEDfiles 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).
-
-