Class 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 the path 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)  
      • Methods inherited from class net.morimekta.providence.types.TypeRegistry

        finalTypeReference, getServiceProvider, getTypeProvider, getTypeProvider, requireDeclaredType, requireEnumType, requireMessageType, requireService
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GlobalRegistry

        public GlobalRegistry()
        Create an empty program registry.
    • Method Detail

      • registryForPath

        @Nonnull
        public ProgramRegistry registryForPath​(java.lang.String filePath)
      • getDeclaredType

        @Nonnull
        public java.util.Optional<net.morimekta.providence.descriptor.PDeclaredDescriptor<?>> getDeclaredType​(@Nonnull
                                                                                                              net.morimekta.providence.types.TypeReference reference)
        Specified by:
        getDeclaredType in class net.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 class net.morimekta.providence.types.TypeRegistry
      • getConstantValue

        @Nonnull
        public <T> java.util.Optional<T> getConstantValue​(@Nonnull
                                                          net.morimekta.providence.types.TypeReference reference)
        Specified by:
        getConstantValue in class net.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 class net.morimekta.providence.types.TypeRegistry
      • getDeclaredTypes

        public java.util.List<net.morimekta.providence.descriptor.PDeclaredDescriptor<?>> getDeclaredTypes()
        Specified by:
        getDeclaredTypes in class net.morimekta.providence.types.TypeRegistry
      • isKnownProgram

        public boolean isKnownProgram​(@Nonnull
                                      java.lang.String program)
        Specified by:
        isKnownProgram in class net.morimekta.providence.types.TypeRegistry