/** * Creates and registers a component type that has not been registered yet. * * @param namedIdentifier * The identifier of the new component type. * @param fullqualifiedName * The fully qualfieid name of the new component type. * * @return the created component type */ public final ComponentType createAndRegisterComponentType(final String namedIdentifier, final String fullqualifiedName) { final ComponentType newInst; synchronized (this) { if (this.componentTypesByName.containsKey(namedIdentifier)) { throw new IllegalArgumentException("Element with name " + namedIdentifier + "exists already"); } final int id = this.getAndIncrementNextId(); newInst = new ComponentType(id, fullqualifiedName); this.componentTypesById.put(id, newInst); this.componentTypesByName.put(namedIdentifier, newInst); } return newInst; }
.lookupAssemblyComponentInstanceByNamedIdentifier(assemblyComponentTypeName); if (assemblyComponent == null) { // assembly instance doesn't exist ComponentType componentType = systemModelRepository.getTypeRepositoryFactory().lookupComponentTypeByNamedIdentifier(assemblyComponentTypeName); if (componentType == null) { // NOPMD NOCS (NestedIf) componentType = systemModelRepository.getTypeRepositoryFactory().createAndRegisterComponentType(assemblyComponentTypeName, assemblyComponentTypeName);
/** * Creates a new instance of this class using the given parameters. * * @param configuration * The configuration to use for this repository. * @param projectContext * The project context to use for this repository. */ public SystemModelRepository(final Configuration configuration, final IProjectContext projectContext) { super(configuration, projectContext); this.typeRepositoryFactory = new TypeRepository(this); this.assemblyFactory = new AssemblyRepository(this); this.executionEnvironmentFactory = new ExecutionEnvironmentRepository(this); this.allocationFactory = new AllocationRepository(this); this.operationFactory = new OperationRepository(this); this.allocationPairFactory = new AllocationComponentOperationPairFactory(this); this.assemblyPairFactory = new AssemblyComponentOperationPairFactory(this); }
this.printOpenSurroundingSpan(ps); this.printOpenHtmlTable(ps, "Component Types", new String[] { "ID", "Package", "Name", "Operations" }); final Collection<ComponentType> componentTypes = this.typeRepositoryFactory.getComponentTypes(); for (final ComponentType type : componentTypes) { final StringBuilder opListBuilder = new StringBuilder();
ComponentType componentTypeA = this.systemEntityFactory.getTypeRepositoryFactory().lookupComponentTypeByNamedIdentifier(componentTypeName); if (componentTypeA == null) { componentTypeA = this.systemEntityFactory.getTypeRepositoryFactory().createAndRegisterComponentType(componentTypeName, componentTypeName);