@Test public void testGetComponentType() { Assert.assertNull(registry.getComponentType("someType"), "components should be empty prior to populating registry"); ComponentTypeInfo info = new ComponentTypeInfo("displayName", "desc", TestBaseComponent.class); ExtendedComponentProvider provider = createProvider(Collections.singletonList(info), null); registry.refreshComponents(Collections.singletonList(provider)); Assert.assertEquals(TestBaseComponent.class, registry.getComponentType(TestBaseComponent.class.getName()),"supplied info must be equal"); registry.refreshComponents(Collections.<ExtendedComponentProvider>emptyList()); Assert.assertNull(registry.getComponentType(TestBaseComponent.class.getName()),"removing provider must also remove component types"); }
Class<? extends AbstractComponent> getComponentType(String componentTypeId) { ComponentTypeInfo info = availableComponents.get(componentTypeId); Class<? extends AbstractComponent> componentClass = null; if (info != null) { componentClass = info.getComponentClass(); } return componentClass; }
ExternalComponentRegistryImpl implements CoreComponentRegistry { Class<? extends AbstractComponent> getComponentType(String componentTypeId) { ComponentTypeInfo info = availableComponents.get(componentTypeId); Class<? extends AbstractComponent> componentClass = null; if (info != null) { componentClass = info.getComponentClass(); } return componentClass; } }
ExternalComponentRegistryImpl implements CoreComponentRegistry { Class<? extends AbstractComponent> getComponentType(String componentTypeId) { ComponentTypeInfo info = availableComponents.get(componentTypeId); Class<? extends AbstractComponent> componentClass = null; if (info != null) { componentClass = info.getComponentClass(); } return componentClass; } ExternalComponentRegistryImpl(); }
ExternalComponentRegistryImpl implements CoreComponentRegistry { Class<? extends AbstractComponent> getComponentType(String componentTypeId) { ComponentTypeInfo info = availableComponents.get(componentTypeId); Class<? extends AbstractComponent> componentClass = null; if (info != null) { componentClass = info.getComponentClass(); } return componentClass; } ExternalComponentRegistryImpl(); static ExternalComponentRegistryImpl getInstance(); @Override Set<ViewInfo> getViewInfos(String componentTypeId, ViewType type); Collection<ExtendedComponentTypeInfo> getComponentInfos(); @Override T getAsset(TypeInfo<?> objectType, Class<T> assetClass); void setDefaultViewProvider(ComponentProvider provider); @Override AbstractComponent newInstance(ComponentTypeInfo componentTypeInfo); @Override AbstractComponent newCollection(Collection<AbstractComponent> components); @Override T newInstance(Class<T> componentClass, AbstractComponent parent); void refreshComponents(List<ExtendedComponentProvider> providers); @Override AbstractComponent getComponent(String id); @Override boolean isCreatable(Class<?> clazz); @Override AbstractComponent newInstance(String componentType); }
ExternalComponentRegistryImpl implements CoreComponentRegistry { Class<? extends AbstractComponent> getComponentType(String componentTypeId) { ComponentTypeInfo info = availableComponents.get(componentTypeId); Class<? extends AbstractComponent> componentClass = null; if (info != null) { componentClass = info.getComponentClass(); } return componentClass; } ExternalComponentRegistryImpl(); static ExternalComponentRegistryImpl getInstance(); @Override Set<ViewInfo> getViewInfos(String componentTypeId, ViewType type); Collection<ExtendedComponentTypeInfo> getComponentInfos(); @Override T getAsset(TypeInfo<?> objectType, Class<T> assetClass); void setDefaultViewProvider(ComponentProvider provider); @Override AbstractComponent newInstance(ComponentTypeInfo componentTypeInfo); @Override AbstractComponent newCollection(Collection<AbstractComponent> components); @Override T newInstance(Class<T> componentClass, AbstractComponent parent); void refreshComponents(List<ExtendedComponentProvider> providers); @Override AbstractComponent getComponent(String id); @Override boolean isCreatable(Class<?> clazz); @Override AbstractComponent newInstance(String componentType); static final byte USER_DEFINED_GROUP_PERMISSION; }