Class FileDescriptor


  • public final class FileDescriptor
    extends Object
    Representation of a .proto file, including its dependencies.
    Since:
    2.0
    Author:
    gustavonalle, anistor@redhat.com
    • Method Detail

      • setConfiguration

        public void setConfiguration​(Configuration configuration)
        This method is not part of the public API. May be removed in future versions.
      • 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. Only FileDescriptor.Status.UNRESOLVED files are processed. Files with other states are ignored.
        Throws:
        DescriptorParserException
      • getName

        public String getName()
      • getPackage

        public String getPackage()
      • getMessageTypes

        public List<Descriptor> getMessageTypes()
        Top level message types defined in this file.