@Test public void testGetProvider_bad() { try { registry.getProvider("map<real>", "calculator", null); fail("no exception"); } catch (IllegalArgumentException e) { assertThat(e.getMessage(), is("Invalid map generic part \"map<real>\": missing ',' kv separator")); } try { registry.getProvider("map<real,real,number.I>", "calculator", null); fail("no exception"); } catch (IllegalArgumentException e) { assertThat(e.getMessage(), is("Invalid map generic part \"map<real,real,number.I>\": " + "Invalid atomic type name real,number.I")); } try { registry.getProvider("set<real,number.I>", "calculator", null); fail("no exception"); } catch (IllegalArgumentException e) { assertThat(e.getMessage(), is("Invalid set generic part \"set<real,number.I>\": " + "Invalid atomic type name real,number.I")); } try { registry.getProvider("list<real,number.I>", "calculator", null); fail("no exception"); } catch (IllegalArgumentException e) { assertThat(e.getMessage(), is("Invalid list generic part \"list<real,number.I>\": " + "Invalid atomic type name real,number.I")); } }
@Nonnull @Override public PDescriptorProvider getProvider(String typeName, String programContext, Map<String, String> annotations) { return handle(typeName, programContext, false, r -> r.getProvider(typeName, programContext, annotations)); }
ProgramRegistry implements TypeRegistry { @Nonnull @Override public PDescriptorProvider getProvider(String typeName, String programContext, Map<String, String> annotations) { return handle(typeName, programContext, false, r -> r.getProvider(typeName, programContext, annotations)); } }
ProgramRegistry implements TypeRegistry { @Nonnull @Override public PDescriptorProvider getProvider(String typeName, String programContext, Map<String, String> annotations) { return handle(typeName, programContext, false, r -> r.getProvider(typeName, programContext, annotations)); } ProgramRegistry(); }
ProgramRegistry implements TypeRegistry { @Nonnull @Override public PDescriptorProvider getProvider(String typeName, String programContext, Map<String, String> annotations) { return handle(typeName, programContext, false, r -> r.getProvider(typeName, programContext, annotations)); } ProgramRegistry(); @Nonnull ProgramTypeRegistry registryForPath(String path); @Nonnull Collection<ProgramTypeRegistry> getLoadedRegistries(); boolean containsProgramPath(String path); void putProgram(String path, CProgram program); void putProgramType(String path, ProgramType program); @Nonnull @Override T getDeclaredType(@Nonnull String typeName,
                                                                @Nonnull String programContext); @Nullable @Override T getConstantValue(@Nonnull String constReference, @Nonnull String programContext); @Nonnull @Override PService getService(String serviceName, String programContext); @Nonnull @Override PDescriptorProvider getProvider(String typeName, String programContext, Map<String, String> annotations); @Nonnull @Override PServiceProvider getServiceProvider(String serviceName, String programContext); }
ProgramRegistry implements TypeRegistry { @Nonnull @Override public PDescriptorProvider getProvider(String typeName, String programContext, Map<String, String> annotations) { return handle(typeName, programContext, false, r -> r.getProvider(typeName, programContext, annotations)); } ProgramRegistry(); @Nonnull ProgramTypeRegistry registryForPath(String path); @Nonnull Collection<ProgramTypeRegistry> getLoadedRegistries(); boolean containsProgramPath(String path); void putProgram(String path, CProgram program); void putProgramType(String path, ProgramType program); @Nonnull @Override T getDeclaredType(@Nonnull String typeName,
                                                                @Nonnull String programContext); @Nullable @Override T getConstantValue(@Nonnull String constReference, @Nonnull String programContext); @Nonnull @Override PService getService(String serviceName, String programContext); @Nonnull @Override PDescriptorProvider getProvider(String typeName, String programContext, Map<String, String> annotations); @Nonnull @Override PServiceProvider getServiceProvider(String serviceName, String programContext);  }