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]
  • Method Details

    • 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. Only FileDescriptor.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()
    • getOptions

      public List<Option> getOptions()
    • getOption

      public Option getOption(String name)
    • getEnumTypes

      public List<EnumDescriptor> getEnumTypes()
    • getMessageTypes

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

      public Map<String,GenericDescriptor> getTypes()
      All types defined in this file (both message and enum).
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • fullName

      public static String fullName(String parent, String name)