/** Adds a type to collection. */ private void addTypeInternal(AbstractTypeDefinition type) { if (type == null) { return; } TypeDefinitionContainerImpl tc = new TypeDefinitionContainerImpl(); tc.setTypeDefinition(type); // add to parent if (type.getParentTypeId() != null) { TypeDefinitionContainerImpl tdc = fTypes.get(type.getParentTypeId()); if (tdc != null) { if (tdc.getChildren() == null) { tdc.setChildren(new ArrayList<TypeDefinitionContainer>()); } tdc.getChildren().add(tc); } } fTypes.put(type.getId(), tc); }