public class SimpleTypeRegistry extends WritableTypeRegistry
| Constructor and Description |
|---|
SimpleTypeRegistry() |
| Modifier and Type | Method and Description |
|---|---|
<T> Optional<T> |
getConstantValue(TypeReference reference)
This is to check to find a constant given the const name and program context.
|
Optional<PDeclaredDescriptor<?>> |
getDeclaredType(TypeReference reference)
Get the declared type with the given name and program context.
|
List<PDeclaredDescriptor<?>> |
getDeclaredTypes() |
Optional<PService> |
getService(TypeReference reference)
Get a service definition from the name and program context.
|
Optional<TypeReference> |
getTypedef(TypeReference reference)
Get a type-definition for the given reference.
|
boolean |
isKnownProgram(String programName) |
void |
registerConstant(TypeReference reference,
PValueProvider value)
Register a constant value.
|
void |
registerService(PService service)
Services are not handled as "declared types", so they need to be registered
separately.
|
<T> void |
registerType(PDeclaredDescriptor<T> declaredType)
Register a declared type.
|
void |
registerTypedef(TypeReference reference,
TypeReference target)
Registers a typedef definition.
|
finalTypeReference, getServiceProvider, getTypeProvider, getTypeProvider, requireDeclaredType, requireEnumType, requireMessageType, requireServicepublic boolean isKnownProgram(@Nonnull String programName)
isKnownProgram in class TypeRegistryprogramName - The program name.@Nonnull public Optional<TypeReference> getTypedef(@Nonnull TypeReference reference)
TypeRegistrygetTypedef in class TypeRegistryreference - The typedef reference.public List<PDeclaredDescriptor<?>> getDeclaredTypes()
getDeclaredTypes in class TypeRegistry@Nonnull public Optional<PDeclaredDescriptor<?>> getDeclaredType(@Nonnull TypeReference reference)
TypeRegistrygetDeclaredType in class TypeRegistryreference - The reference to the type.@Nonnull public Optional<PService> getService(@Nonnull TypeReference reference)
TypeRegistrygetService in class TypeRegistryreference - The service reference.@Nonnull public <T> Optional<T> getConstantValue(@Nonnull TypeReference reference)
TypeRegistrygetConstantValue in class TypeRegistryT - The returned value type.reference - The constant reference.public void registerTypedef(@Nonnull TypeReference reference, @Nonnull TypeReference target)
WritableTypeRegistryregisterTypedef in class WritableTypeRegistryreference - The typedef reference source..target - The qualified type definition that the name represents
with it's own context.public void registerConstant(@Nonnull TypeReference reference, @Nonnull PValueProvider value)
WritableTypeRegistryregisterConstant in class WritableTypeRegistryreference - The constant reference.value - The constant value.public void registerService(@Nonnull PService service)
WritableTypeRegistryregisterService in class WritableTypeRegistryservice - the service to register.public <T> void registerType(PDeclaredDescriptor<T> declaredType)
WritableTypeRegistryregisterType in class WritableTypeRegistryT - The declared java type.declaredType - The descriptor for the type.Copyright © 2015–2020 morimekta.net. All rights reserved.