Package com.google.protobuf
Class TypeRegistry
- java.lang.Object
-
- com.google.protobuf.TypeRegistry
-
public class TypeRegistry extends java.lang.Object
A TypeRegistry is used to resolve Any messages. You must provide a TypeRegistry containing all message types used in Any message fields.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TypeRegistry.Builder
A Builder is used to buildTypeRegistry
.private static class
TypeRegistry.EmptyTypeRegistryHolder
-
Field Summary
Fields Modifier and Type Field Description private static java.util.logging.Logger
logger
private java.util.Map<java.lang.String,Descriptors.Descriptor>
types
-
Constructor Summary
Constructors Constructor Description TypeRegistry(java.util.Map<java.lang.String,Descriptors.Descriptor> types)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Descriptors.Descriptor
find(java.lang.String name)
Find a type by its full name.Descriptors.Descriptor
getDescriptorForTypeUrl(java.lang.String typeUrl)
Find a type by its typeUrl.static TypeRegistry
getEmptyTypeRegistry()
private static java.lang.String
getTypeName(java.lang.String typeUrl)
static TypeRegistry.Builder
newBuilder()
-
-
-
Field Detail
-
logger
private static final java.util.logging.Logger logger
-
types
private final java.util.Map<java.lang.String,Descriptors.Descriptor> types
-
-
Constructor Detail
-
TypeRegistry
TypeRegistry(java.util.Map<java.lang.String,Descriptors.Descriptor> types)
-
-
Method Detail
-
getEmptyTypeRegistry
public static TypeRegistry getEmptyTypeRegistry()
-
newBuilder
public static TypeRegistry.Builder newBuilder()
-
find
public Descriptors.Descriptor find(java.lang.String name)
Find a type by its full name. Returns null if it cannot be found in thisTypeRegistry
.
-
getDescriptorForTypeUrl
public final Descriptors.Descriptor getDescriptorForTypeUrl(java.lang.String typeUrl) throws InvalidProtocolBufferException
Find a type by its typeUrl. Returns null if it cannot be found in thisTypeRegistry
.- Throws:
InvalidProtocolBufferException
-
getTypeName
private static java.lang.String getTypeName(java.lang.String typeUrl) throws InvalidProtocolBufferException
- Throws:
InvalidProtocolBufferException
-
-