Package net.morimekta.providence.reflect
Class GlobalRegistry
- java.lang.Object
-
- net.morimekta.providence.types.TypeRegistry
-
- net.morimekta.providence.reflect.GlobalRegistry
-
public class GlobalRegistry extends net.morimekta.providence.types.TypeRegistry
A global type registry containing lots of individual program registries for each program. The program registry is a wrapper around a set of type registries for each of a set of different files. The individual registries are identified by thepath
to the thrift file that was parsed.
-
-
Constructor Summary
Constructors Constructor Description GlobalRegistry()
Create an empty program registry.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> java.util.Optional<T>
getConstantValue(net.morimekta.providence.types.TypeReference reference)
java.util.Optional<net.morimekta.providence.descriptor.PDeclaredDescriptor<?>>
getDeclaredType(net.morimekta.providence.types.TypeReference reference)
java.util.List<net.morimekta.providence.descriptor.PDeclaredDescriptor<?>>
getDeclaredTypes()
java.util.List<ProgramRegistry>
getRegistries()
java.util.Optional<net.morimekta.providence.descriptor.PService>
getService(net.morimekta.providence.types.TypeReference reference)
java.util.Optional<net.morimekta.providence.types.TypeReference>
getTypedef(net.morimekta.providence.types.TypeReference reference)
boolean
isKnownProgram(java.lang.String program)
ProgramRegistry
registryForPath(java.lang.String filePath)
-
-
-
Method Detail
-
registryForPath
@Nonnull public ProgramRegistry registryForPath(java.lang.String filePath)
-
getRegistries
public java.util.List<ProgramRegistry> getRegistries()
-
getDeclaredType
@Nonnull public java.util.Optional<net.morimekta.providence.descriptor.PDeclaredDescriptor<?>> getDeclaredType(@Nonnull net.morimekta.providence.types.TypeReference reference)
- Specified by:
getDeclaredType
in classnet.morimekta.providence.types.TypeRegistry
-
getService
@Nonnull public java.util.Optional<net.morimekta.providence.descriptor.PService> getService(@Nonnull net.morimekta.providence.types.TypeReference reference)
- Specified by:
getService
in classnet.morimekta.providence.types.TypeRegistry
-
getConstantValue
@Nonnull public <T> java.util.Optional<T> getConstantValue(@Nonnull net.morimekta.providence.types.TypeReference reference)
- Specified by:
getConstantValue
in classnet.morimekta.providence.types.TypeRegistry
-
getTypedef
@Nonnull public java.util.Optional<net.morimekta.providence.types.TypeReference> getTypedef(@Nonnull net.morimekta.providence.types.TypeReference reference)
- Specified by:
getTypedef
in classnet.morimekta.providence.types.TypeRegistry
-
getDeclaredTypes
public java.util.List<net.morimekta.providence.descriptor.PDeclaredDescriptor<?>> getDeclaredTypes()
- Specified by:
getDeclaredTypes
in classnet.morimekta.providence.types.TypeRegistry
-
isKnownProgram
public boolean isKnownProgram(@Nonnull java.lang.String program)
- Specified by:
isKnownProgram
in classnet.morimekta.providence.types.TypeRegistry
-
-