Class DynamicMessageFactory

  • All Implemented Interfaces:
    MessageFactory

    @Immutable
    @Deprecated
    public final class DynamicMessageFactory
    extends java.lang.Object
    implements MessageFactory
    Deprecated.
    Do not use. CEL-Java users should leverage the Fluent APIs instead. See CelRuntimeFactory.
    The DynamicMessageFactory creates DynamicMessage instances by protobuf name.

    Creating message with DynamicMessage is significantly slower than instantiating messages directly as it uses Java reflection.

    • Method Detail

      • typeProvider

        @Deprecated
        public static RuntimeTypeProvider typeProvider​(java.util.Collection<Descriptors.Descriptor> descriptors)
        Deprecated.
        Use CEL Fluent APIs instead. Directly instantiating DynamicMessageFactory's RuntimeTypeProvider is no longer needed.
        Create a RuntimeTypeProvider which can access only the types listed in the input descriptors using the CelOptions.LEGACY settings.
      • typeFactory

        @Deprecated
        public static MessageFactory typeFactory​(java.util.Collection<Descriptors.Descriptor> descriptors)
        Deprecated.
        Use CEL Fluent APIs instead. Directly instantiating DynamicMessageFactory is no longer needed.
        Create a MessageFactory which can produce any protobuf type in the generated descriptor pool or in the input descriptors.
      • toProtoMessageFactory

        public ProtoMessageFactory toProtoMessageFactory()
        Deprecated.
        Description copied from interface: MessageFactory
        Exists only to maintain FunctionalInterface requirement and to make legacy Dynamic/Linked message factories compatible with the new ProtoMessageFactory.
        Specified by:
        toProtoMessageFactory in interface MessageFactory
      • newBuilder

        public @Nullable Message.Builder newBuilder​(java.lang.String messageName)
        Deprecated.
        Description copied from interface: MessageFactory
        Create a Message.Builder instance for the protobuf by messageName.

        Returns null if the builder could not be created.

        Specified by:
        newBuilder in interface MessageFactory