Package dev.cel.common
Class CelDescriptorUtil
- java.lang.Object
-
- dev.cel.common.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 CelDescriptorsgetAllDescriptorsFromFileDescriptor(com.google.protobuf.Descriptors.FileDescriptor... fileDescriptors)Extract the full messageCelDescriptorsset from the input set offileDescriptors.static CelDescriptorsgetAllDescriptorsFromFileDescriptor(java.lang.Iterable<com.google.protobuf.Descriptors.FileDescriptor> fileDescriptors)Extract the full messageCelDescriptorsset from the input set offileDescriptors.static CelDescriptorsgetAllDescriptorsFromFileDescriptor(java.lang.Iterable<com.google.protobuf.Descriptors.FileDescriptor> fileDescriptors, boolean resolveTypeDependencies)Extract the full messageFileDescriptorset from the input set offileDescriptors.static com.google.common.collect.ImmutableSet<com.google.protobuf.Descriptors.FileDescriptor>getFileDescriptorsForDescriptors(java.lang.Iterable<com.google.protobuf.Descriptors.Descriptor> descriptors)Get the fullFileDescriptorset needed to accurately instantiate thedescriptors.static com.google.common.collect.ImmutableSet<com.google.protobuf.Descriptors.FileDescriptor>getFileDescriptorsFromFileDescriptorSet(com.google.protobuf.DescriptorProtos.FileDescriptorSet fileDescriptorSet)Convert aFileDescriptorSetinto a set ofFileDescriptorinstances.
-
-
-
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 fullFileDescriptorset needed to accurately instantiate thedescriptors.
-
getFileDescriptorsFromFileDescriptorSet
public static com.google.common.collect.ImmutableSet<com.google.protobuf.Descriptors.FileDescriptor> getFileDescriptorsFromFileDescriptorSet(com.google.protobuf.DescriptorProtos.FileDescriptorSet fileDescriptorSet)
Convert aFileDescriptorSetinto a set ofFileDescriptorinstances.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 messageCelDescriptorsset from the input set offileDescriptors. All message type, enum, extension and file descriptors will be extracted.Note, the input
fileDescriptorsset 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 messageCelDescriptorsset from the input set offileDescriptors. All message type, enum, extension and file descriptors will be extracted.Note, the input
fileDescriptorsset 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 messageFileDescriptorset from the input set offileDescriptors. 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.
-
-