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.TypeRegistryA 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 thepathto 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)booleanisKnownProgram(java.lang.String program)ProgramRegistryregistryForPath(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:
getDeclaredTypein 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:
getServicein classnet.morimekta.providence.types.TypeRegistry
-
getConstantValue
@Nonnull public <T> java.util.Optional<T> getConstantValue(@Nonnull net.morimekta.providence.types.TypeReference reference)- Specified by:
getConstantValuein 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:
getTypedefin classnet.morimekta.providence.types.TypeRegistry
-
getDeclaredTypes
public java.util.List<net.morimekta.providence.descriptor.PDeclaredDescriptor<?>> getDeclaredTypes()
- Specified by:
getDeclaredTypesin classnet.morimekta.providence.types.TypeRegistry
-
isKnownProgram
public boolean isKnownProgram(@Nonnull java.lang.String program)- Specified by:
isKnownProgramin classnet.morimekta.providence.types.TypeRegistry
-
-