Classes | Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes | List of all members
com.google.protobuf.ExtensionRegistryLite Class Reference
Inheritance diagram for com.google.protobuf.ExtensionRegistryLite:
Inheritance graph
[legend]

Classes

class  ObjectIntPair
 

Public Member Functions

final void add (ExtensionLite<?, ?> extension)
 
final void add (final GeneratedMessageLite.GeneratedExtension<?, ?> extension)
 
ExtensionRegistryLite getUnmodifiable ()
 

Static Public Member Functions

static ExtensionRegistryLite getEmptyRegistry ()
 
static boolean isEagerlyParseMessageSets ()
 
static ExtensionRegistryLite newInstance ()
 
static void setEagerlyParseMessageSets (boolean isEagerlyParse)
 

Private Attributes

final Map< ObjectIntPair, GeneratedMessageLite.GeneratedExtension<?, ?> > extensionsByNumber
 

Static Private Attributes

static boolean doFullRuntimeInheritanceCheck = true
 
static volatile boolean eagerlyParseMessageSets = false
 
static volatile ExtensionRegistryLite emptyRegistry
 
static final Class<?> extensionClass = resolveExtensionClass()
 

Detailed Description

Equivalent to ExtensionRegistry but supports only "lite" types.

If all of your types are lite types, then you only need to use

ExtensionRegistryLite

. Similarly, if all your types are regular types, then you only need ExtensionRegistry. Typically it does not make sense to mix the two, since if you have any regular types in your program, you then require the full runtime and lose all the benefits of the lite runtime, so you might as well make all your types be regular types. However, in some cases (e.g. when depending on multiple third-party libraries where one uses lite types and one uses regular), you may find yourself wanting to mix the two. In this case things get more complicated.

There are three factors to consider: Whether the type being extended is lite, whether the embedded type (in the case of a message-typed extension) is lite, and whether the extension itself is lite. Since all three are declared in different files, they could all be different. Here are all the combinations and which type of registry to use:

  Extended type     Inner type    Extension         Use registry
  =======================================================================
  lite              lite          lite              ExtensionRegistryLite
  lite              regular       lite              ExtensionRegistry
  regular           regular       regular           ExtensionRegistry
  all other combinations                            not supported

Note that just as regular types are not allowed to contain lite-type fields, they are also not allowed to contain lite-type extensions. This is because regular types must be fully accessible via reflection, which in turn means that all the inner messages must also support reflection. On the other hand, since regular types implement the entire lite interface, there is no problem with embedding regular types inside lite types.

Author
kento.nosp@m.n@go.nosp@m.ogle..nosp@m.com Kenton Varda

Definition at line 70 of file ExtensionRegistryLite.java.

Member Function Documentation

◆ add() [1/2]

final void com.google.protobuf.ExtensionRegistryLite.add ( ExtensionLite<?, ?>  extension)
inline

Add an extension from a lite generated file to the registry only if it is a non-lite extension i.e. GeneratedMessageLite.GeneratedExtension.

Definition at line 172 of file ExtensionRegistryLite.java.

◆ add() [2/2]

final void com.google.protobuf.ExtensionRegistryLite.add ( final GeneratedMessageLite.GeneratedExtension<?, ?>  extension)
inline

Add an extension from a lite generated file to the registry.

Definition at line 162 of file ExtensionRegistryLite.java.

◆ getEmptyRegistry()

static ExtensionRegistryLite com.google.protobuf.ExtensionRegistryLite.getEmptyRegistry ( )
inlinestatic

Get the unmodifiable singleton empty instance of either ExtensionRegistryLite or

ExtensionRegistry

(if the full (non-Lite) proto libraries are available).

Reimplemented in com.google.protobuf.ExtensionRegistry.

Definition at line 125 of file ExtensionRegistryLite.java.

◆ getUnmodifiable()

ExtensionRegistryLite com.google.protobuf.ExtensionRegistryLite.getUnmodifiable ( )
inline

Returns an unmodifiable view of the registry.

Reimplemented in com.google.protobuf.ExtensionRegistry.

Definition at line 144 of file ExtensionRegistryLite.java.

◆ isEagerlyParseMessageSets()

static boolean com.google.protobuf.ExtensionRegistryLite.isEagerlyParseMessageSets ( )
inlinestatic

Definition at line 99 of file ExtensionRegistryLite.java.

◆ newInstance()

static ExtensionRegistryLite com.google.protobuf.ExtensionRegistryLite.newInstance ( )
inlinestatic

Construct a new, empty instance.

This may be an

ExtensionRegistry

if the full (non-Lite) proto libraries are available.

Reimplemented in com.google.protobuf.ExtensionRegistry.

Definition at line 113 of file ExtensionRegistryLite.java.

◆ setEagerlyParseMessageSets()

static void com.google.protobuf.ExtensionRegistryLite.setEagerlyParseMessageSets ( boolean  isEagerlyParse)
inlinestatic

Definition at line 103 of file ExtensionRegistryLite.java.

Member Data Documentation

◆ doFullRuntimeInheritanceCheck

boolean com.google.protobuf.ExtensionRegistryLite.doFullRuntimeInheritanceCheck = true
staticprivate

Definition at line 81 of file ExtensionRegistryLite.java.

◆ eagerlyParseMessageSets

volatile boolean com.google.protobuf.ExtensionRegistryLite.eagerlyParseMessageSets = false
staticprivate

Definition at line 77 of file ExtensionRegistryLite.java.

◆ emptyRegistry

volatile ExtensionRegistryLite com.google.protobuf.ExtensionRegistryLite.emptyRegistry
staticprivate

Definition at line 119 of file ExtensionRegistryLite.java.

◆ extensionClass

final Class<?> com.google.protobuf.ExtensionRegistryLite.extensionClass = resolveExtensionClass()
staticprivate

Definition at line 97 of file ExtensionRegistryLite.java.

◆ extensionsByNumber

final Map<ObjectIntPair, GeneratedMessageLite.GeneratedExtension<?, ?> > com.google.protobuf.ExtensionRegistryLite.extensionsByNumber
private

Definition at line 208 of file ExtensionRegistryLite.java.


The documentation for this class was generated from the following file:


libaditof
Author(s):
autogenerated on Wed May 21 2025 02:07:07