public abstract class TypeRegistry extends Object
Modifier | Constructor and Description |
---|---|
protected |
TypeRegistry() |
Modifier and Type | Method and Description |
---|---|
protected TypeReference |
finalTypeReference(TypeReference reference)
Get the final typename of the given identifier within the context.
|
abstract <T> Optional<T> |
getConstantValue(TypeReference reference)
This is to check to find a constant given the const name and program context.
|
abstract Optional<PDeclaredDescriptor<?>> |
getDeclaredType(TypeReference reference)
Get the declared type with the given name and program context.
|
abstract List<PDeclaredDescriptor<?>> |
getDeclaredTypes() |
abstract Optional<PService> |
getService(TypeReference reference)
Get a service definition from the name and program context.
|
PServiceProvider |
getServiceProvider(TypeReference reference) |
abstract Optional<TypeReference> |
getTypedef(TypeReference reference)
Get a type-definition for the given reference.
|
PDescriptorProvider |
getTypeProvider(TypeReference reference)
Get a type provider for reference.
|
PDescriptorProvider |
getTypeProvider(TypeReference reference,
Map<String,String> annotations) |
abstract boolean |
isKnownProgram(String program) |
PDeclaredDescriptor |
requireDeclaredType(TypeReference reference)
Get the declared type with the given name and program context.
|
<E extends PEnumValue<E>> |
requireEnumType(TypeReference reference)
Get the declared enum type.
|
<M extends PMessage<M>> |
requireMessageType(TypeReference reference)
Get the declared message type.
|
PService |
requireService(TypeReference reference)
Get the declared type with the given name and program context.
|
@Nonnull public abstract Optional<PDeclaredDescriptor<?>> getDeclaredType(@Nonnull TypeReference reference)
reference
- The reference to the type.@Nonnull public abstract Optional<PService> getService(@Nonnull TypeReference reference)
reference
- The service reference.@Nonnull public abstract <T> Optional<T> getConstantValue(@Nonnull TypeReference reference)
T
- The returned value type.reference
- The constant reference.@Nonnull public abstract Optional<TypeReference> getTypedef(@Nonnull TypeReference reference)
reference
- The typedef reference.public abstract List<PDeclaredDescriptor<?>> getDeclaredTypes()
public abstract boolean isKnownProgram(@Nonnull String program)
program
- The program name.@Nonnull public PDeclaredDescriptor requireDeclaredType(@Nonnull TypeReference reference)
reference
- The reference to the type.@Nonnull public <M extends PMessage<M>> PMessageDescriptor<M> requireMessageType(@Nonnull TypeReference reference)
M
- The message type.reference
- The type reference.@Nonnull public <E extends PEnumValue<E>> PEnumDescriptor<E> requireEnumType(@Nonnull TypeReference reference)
E
- The enum value type.reference
- The type reference.@Nonnull public PService requireService(@Nonnull TypeReference reference)
reference
- The reference to the type.@Nonnull public PDescriptorProvider getTypeProvider(@Nonnull TypeReference reference)
reference
- Type reference to get provider for.@Nonnull public PDescriptorProvider getTypeProvider(@Nonnull TypeReference reference, @Nonnull Map<String,String> annotations)
@Nonnull public PServiceProvider getServiceProvider(@Nonnull TypeReference reference)
@Nonnull protected TypeReference finalTypeReference(@Nonnull TypeReference reference)
reference
- The type name.Copyright © 2015–2020 morimekta.net. All rights reserved.