Class CelDescriptorUtil


  • @Internal
    public final class CelDescriptorUtil
    extends java.lang.Object
    Utility class for working with protobuf descriptors.

    CEL Library Internals. Do Not Use.

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static CelDescriptors getAllDescriptorsFromFileDescriptor​(com.google.protobuf.Descriptors.FileDescriptor... fileDescriptors)
      Extract the full message CelDescriptors set from the input set of fileDescriptors.
      static CelDescriptors getAllDescriptorsFromFileDescriptor​(java.lang.Iterable<com.google.protobuf.Descriptors.FileDescriptor> fileDescriptors)
      Extract the full message CelDescriptors set from the input set of fileDescriptors.
      static CelDescriptors getAllDescriptorsFromFileDescriptor​(java.lang.Iterable<com.google.protobuf.Descriptors.FileDescriptor> fileDescriptors, boolean resolveTypeDependencies)
      Extract the full message FileDescriptor set from the input set of fileDescriptors.
      static com.google.common.collect.ImmutableSet<com.google.protobuf.Descriptors.FileDescriptor> getFileDescriptorsForDescriptors​(java.lang.Iterable<com.google.protobuf.Descriptors.Descriptor> descriptors)
      Get the full FileDescriptor set needed to accurately instantiate the descriptors.
      static com.google.common.collect.ImmutableSet<com.google.protobuf.Descriptors.FileDescriptor> getFileDescriptorsFromFileDescriptorSet​(com.google.protobuf.DescriptorProtos.FileDescriptorSet fileDescriptorSet)
      Convert a FileDescriptorSet into a set of FileDescriptor instances.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getFileDescriptorsForDescriptors

        public static com.google.common.collect.ImmutableSet<com.google.protobuf.Descriptors.FileDescriptor> getFileDescriptorsForDescriptors​(java.lang.Iterable<com.google.protobuf.Descriptors.Descriptor> descriptors)
        Get the full FileDescriptor set needed to accurately instantiate the descriptors.
      • getFileDescriptorsFromFileDescriptorSet

        public static com.google.common.collect.ImmutableSet<com.google.protobuf.Descriptors.FileDescriptor> getFileDescriptorsFromFileDescriptorSet​(com.google.protobuf.DescriptorProtos.FileDescriptorSet fileDescriptorSet)
        Convert a FileDescriptorSet into a set of FileDescriptor instances.

        Warning: This will produce unique FileDescriptor instances. Use with care especially in hermetic environments.

      • getAllDescriptorsFromFileDescriptor

        public static CelDescriptors getAllDescriptorsFromFileDescriptor​(com.google.protobuf.Descriptors.FileDescriptor... fileDescriptors)
        Extract the full message CelDescriptors set from the input set of fileDescriptors. All message type, enum, extension and file descriptors will be extracted.

        Note, the input fileDescriptors set will be expanded to the complete set of dependencies needed to describe the types within the provided files.

      • getAllDescriptorsFromFileDescriptor

        public static CelDescriptors getAllDescriptorsFromFileDescriptor​(java.lang.Iterable<com.google.protobuf.Descriptors.FileDescriptor> fileDescriptors)
        Extract the full message CelDescriptors set from the input set of fileDescriptors. All message type, enum, extension and file descriptors will be extracted.

        Note, the input fileDescriptors set will be expanded to the complete set of dependencies needed to describe the types within the provided files.

      • getAllDescriptorsFromFileDescriptor

        public static CelDescriptors getAllDescriptorsFromFileDescriptor​(java.lang.Iterable<com.google.protobuf.Descriptors.FileDescriptor> fileDescriptors,
                                                                         boolean resolveTypeDependencies)
        Extract the full message FileDescriptor set from the input set of fileDescriptors. All message type, enum, extension and file descriptors will be extracted.
        Parameters:
        resolveTypeDependencies - Performs a deep type dependency resolution by expanding all the FileDescriptors marked as dependents listed in their imports (Ex: If FileDescriptor A imports on FileDescriptor B, FD B's descriptors will be pulled in). Setting false will disable this.