Package net.morimekta.providence.types
Class WritableTypeRegistry
- java.lang.Object
-
- net.morimekta.providence.types.TypeRegistry
-
- net.morimekta.providence.types.WritableTypeRegistry
-
- Direct Known Subclasses:
SimpleTypeRegistry
public abstract class WritableTypeRegistry extends TypeRegistry
Registry for declared types referenced in a specific program context. The registry itself does not have a context per se, as these may reference each other recursively.
-
-
Constructor Summary
Constructors Constructor Description WritableTypeRegistry()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract void
registerConstant(TypeReference reference, PValueProvider value)
Register a constant value.abstract void
registerService(PService service)
Services are not handled as "declared types", so they need to be registered separately.abstract <T> void
registerType(PDeclaredDescriptor<T> declaredType)
Register a declared type.abstract void
registerTypedef(TypeReference reference, TypeReference target)
Registers a typedef definition.-
Methods inherited from class net.morimekta.providence.types.TypeRegistry
finalTypeReference, getConstantValue, getDeclaredType, getDeclaredTypes, getService, getServiceProvider, getTypedef, getTypeProvider, getTypeProvider, isKnownProgram, requireDeclaredType, requireEnumType, requireMessageType, requireService
-
-
-
-
Method Detail
-
registerConstant
public abstract void registerConstant(@Nonnull TypeReference reference, @Nonnull PValueProvider value)
Register a constant value.- Parameters:
reference
- The constant reference.value
- The constant value.
-
registerService
public abstract void registerService(@Nonnull PService service)
Services are not handled as "declared types", so they need to be registered separately.- Parameters:
service
- the service to register.
-
registerType
public abstract <T> void registerType(PDeclaredDescriptor<T> declaredType)
Register a declared type.- Type Parameters:
T
- The declared java type.- Parameters:
declaredType
- The descriptor for the type.
-
registerTypedef
public abstract void registerTypedef(@Nonnull TypeReference reference, @Nonnull TypeReference target)
Registers a typedef definition. This is a pair of two type references. One for the reference itself, and one for the target type definition, including the local program context where it was defined.- Parameters:
reference
- The typedef reference source..target
- The qualified type definition that the name represents with it's own context.
-
-