Commit cf7d38be authored by Sabine Teufl's avatar Sabine Teufl
Browse files

No commit message

No commit message
parent d632f92a
......@@ -6,8 +6,13 @@
</projects>
<buildSpec>
<buildCommand>
<name>org.fortiss.ide.dev_tools.emf.builder.EcoreBuilder</name>
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
<dictionary>
<key>LaunchConfigHandle</key>
<value>&lt;project&gt;/.externalToolBuilders/org.fortiss.ide.dev_tools.emf.builder.EcoreBuilder.launch</value>
</dictionary>
</arguments>
</buildCommand>
<buildCommand>
......
......@@ -14,8 +14,8 @@ Export-Package: org.fortiss.af3.mira,
org.fortiss.af3.mira.command.contextElement,
org.fortiss.af3.mira.compose,
org.fortiss.af3.mira.model,
org.fortiss.af3.mira.model.glossary,
org.fortiss.af3.mira.model.functional,
org.fortiss.af3.mira.model.glossary,
org.fortiss.af3.mira.model.impl,
org.fortiss.af3.mira.model.migration,
org.fortiss.af3.mira.model.relations,
......
......@@ -6,7 +6,7 @@
<eClassifiers xsi:type="ecore:EClass" name="Analysis" eSuperTypes="platform:/resource/org.fortiss.tooling.kernel/model/kernel.ecore#//INamedCommentedElement platform:/resource/org.fortiss.tooling.kernel/model/kernel.ecore#//IProjectRootElement platform:/resource/org.fortiss.tooling.base/model/base.ecore#//element/IHierarchicElement">
<eOperations name="getRequirementsList">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="body" value="return AnalysisStaticImpl.getRequirementsList(this); "/>
<details key="body" value="return AnalysisStaticImpl.getRequirementsList(this);"/>
</eAnnotations>
<eGenericType eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EEList">
<eTypeArguments eClassifier="#//Requirement"/>
......@@ -49,6 +49,16 @@
<details key="body" value="return AnalysisStaticImpl.getAssociatedComponentArchitectures(this);"/>
</eAnnotations>
</eOperations>
<eOperations name="computeReqID" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="body" value="return AnalysisStaticImpl.computeReqID(this);"/>
</eAnnotations>
</eOperations>
<eOperations name="initializeRequirementRelationStatus">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="body" value="AnalysisStaticImpl.initializeRequirementRelationStatus(this);"/>
</eAnnotations>
</eOperations>
<eStructuralFeatures xsi:type="ecore:EReference" name="requirementRelation" upperBound="-1"
eType="#//RequirementRelation" containment="true" eOpposite="#//RequirementRelation/analysis"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="requirementRelationStatus"
......@@ -85,6 +95,22 @@
<details key="body" value="return RequirementStaticImpl.getRequirementShortInfo(this);"/>
</eAnnotations>
</eOperations>
<eOperations name="getRequirementName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="body" value="return RequirementStaticImpl.getRequirementName(this);"/>
</eAnnotations>
</eOperations>
<eOperations name="getRequirementsPackageName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="body" value="return RequirementStaticImpl.getRequirementsPackageName(this);"/>
</eAnnotations>
</eOperations>
<eOperations name="hasSafetyInformation" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="body" value="return RequirementStaticImpl.hasSafetyInformation(this);"/>
</eAnnotations>
</eOperations>
<eOperations name="isSafetyRelevant" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="description" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="rationale" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="author" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
......@@ -418,29 +444,29 @@
<eClassifiers xsi:type="ecore:EClass" name="FormalSpecification" eSuperTypes="platform:/resource/org.fortiss.tooling.base/model/base.ecore#//base/HierarchicElementBase platform:/resource/org.fortiss.af3.project/model/project.ecore#//typesystem/IFunctionScope platform:/resource/org.fortiss.af3.project/model/project.ecore#//typesystem/ITypeScope">
<eOperations name="getTopComponent" eType="ecore:EClass platform:/resource/org.fortiss.af3.component/model/component.ecore#//Component">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="body" value="return (Component) getContainedElements().get(0);"/>
<details key="body" value="return FormalSpecificationStaticImpl.getTopComponent(this);"/>
</eAnnotations>
</eOperations>
<eOperations name="getDefinitionElement" eType="ecore:EClass platform:/resource/org.fortiss.af3.project/model/project.ecore#//typesystem/IFunctionDefinition">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="body" value="return org.fortiss.af3.mira.utils.MiraUtils.getDefinitionElement(this, type);"/>
<details key="body" value="return FormalSpecificationStaticImpl.getDefinitionElement(this, type);"/>
</eAnnotations>
<eParameters name="type" eType="ecore:EClass platform:/resource/org.fortiss.af3.project/model/project.ecore#//typesystem/FunctionCallBase"/>
</eOperations>
<eOperations name="getDefinitionElement" eType="ecore:EClass platform:/resource/org.fortiss.af3.project/model/project.ecore#//typesystem/ITypeDefinition">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="body" value="return org.fortiss.af3.mira.utils.MiraUtils.getDefinitionElement(this, type);"/>
<details key="body" value="return FormalSpecificationStaticImpl.getDefinitionElement(this, type);"/>
</eAnnotations>
<eParameters name="type" eType="ecore:EClass platform:/resource/org.fortiss.af3.project/model/project.ecore#//typesystem/IType"/>
</eOperations>
<eOperations name="getITypeDefinitions" upperBound="-1" eType="ecore:EClass platform:/resource/org.fortiss.af3.project/model/project.ecore#//typesystem/ITypeDefinition">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="body" value="return org.fortiss.af3.mira.utils.MiraUtils.getITypeDefinitionsList(this);"/>
<details key="body" value="return FormalSpecificationStaticImpl.getITypeDefinitions(this);"/>
</eAnnotations>
</eOperations>
<eOperations name="getIFunctionDefinitions" upperBound="-1" eType="ecore:EClass platform:/resource/org.fortiss.af3.project/model/project.ecore#//typesystem/IFunctionDefinition">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="body" value="return org.fortiss.af3.mira.utils.MiraUtils.getIFunctionDefinitionsList(this);"/>
<details key="body" value="return FormalSpecificationStaticImpl.getIFunctionDefinitions(this);"/>
</eAnnotations>
</eOperations>
</eClassifiers>
......
......@@ -31,7 +31,7 @@ import org.fortiss.tooling.kernel.extension.data.Prototype;
* @author mou
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 4A75C14F5F9F72F3698B7CFB101F4F41
* @ConQAT.Rating GREEN Hash: 62482BA970237253DC07CF992EE5CA1B
*/
public class RequirementCompositor implements IElementCompositor<Requirement> {
......
......@@ -33,7 +33,7 @@ import org.fortiss.tooling.kernel.extension.data.Prototype;
* @author mou
* @author $Author: hoelzl $
* @version $Rev: 18709 $
* @ConQAT.Rating YELLOW Hash: 2974DC3BC737052A2900F98C9D2D16FE
* @ConQAT.Rating GREEN Hash: 0C46F926A4518F65119913AC235A58DA
*/
public class UseCaseCompositor implements IElementCompositor<UseCase> {
/** {@inheritDoc} */
......
......@@ -17,18 +17,28 @@ $Id$
+--------------------------------------------------------------------------*/
package org.fortiss.af3.mira.model.impl;
import static org.fortiss.tooling.kernel.utils.EMFResourceUtils.loadModelFromFile;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.getChildrenWithType;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.pickInstanceOf;
import java.util.ArrayList;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.fortiss.af3.component.model.ComponentArchitecture;
import org.fortiss.af3.mira.AF3MiraActivator;
import org.fortiss.af3.mira.model.Analysis;
import org.fortiss.af3.mira.model.ExternalRelation;
import org.fortiss.af3.mira.model.Requirement;
import org.fortiss.af3.mira.model.RequirementsContainer;
import org.fortiss.af3.mira.model.glossary.Glossary;
import org.fortiss.af3.mira.model.relations.RequirementRelationStatus;
import org.fortiss.af3.mira.model.requirementSource.RequirementSource;
import org.fortiss.af3.mira.model.usecase.UseCase;
import org.fortiss.tooling.base.model.element.IModelElement;
import org.fortiss.tooling.kernel.utils.KernelModelElementUtils;
/**
......@@ -37,9 +47,9 @@ import org.fortiss.tooling.kernel.utils.KernelModelElementUtils;
* @author mou
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 71E33A5945B87E5127C8CB251669145D
* @ConQAT.Rating YELLOW Hash: 004B88EFEB3274F11E02FA7872EEDEA3
*/
public class AnalysisStaticImpl {
class AnalysisStaticImpl {
/** Return all contained {@link Requirement} list */
static EList<Requirement> getRequirementsList(Analysis analysis) {
......@@ -82,4 +92,61 @@ public class AnalysisStaticImpl {
}
return arch;
}
/**
* Compute a unused unique requirement ID for the given {@link Analysis}
*
* @param analysis
* the {@link Analysis}
* @return a unused unique requirement ID
*/
static String computeReqID(Analysis analysis) {
String maxID = "";
for(Requirement o : analysis.getRequirementsList()) {
if(maxID.compareTo(o.getReqId()) < 0)
maxID = o.getReqId();
}
return maxID;
}
/** Initialize default {@link RequirementRelationStatus} list for analysis */
static void initializeRequirementRelationStatus(Analysis analysis) {
analysis.getRequirementRelationStatus().clear();
ArrayList<RequirementRelationStatus> statusList =
loadRequirementRelationStatus("/template/RequirementRelationStatusPrototype.xml");
for(RequirementRelationStatus status : statusList) {
analysis.getRequirementRelationStatus().add(status);
}
}
/**
* Load the requirement relation status from fragment xml file.
*
* @param path
* the xml file path
* @return the list of requirement relation status list
*/
private static ArrayList<RequirementRelationStatus> loadRequirementRelationStatus(String path) {
// create check list prototype
ArrayList<RequirementRelationStatus> statusList =
new ArrayList<RequirementRelationStatus>();
EObject root =
loadModelFromFile(URI.createPlatformPluginURI(AF3MiraActivator.PLUGIN_ID + path,
true));
if(root != null && root instanceof IModelElement) {
IModelElement modelElement = (IModelElement)root;
EList<RequirementRelationStatus> initialList =
pickInstanceOf(RequirementRelationStatus.class, modelElement.getReferencedBy());
// copy the checklist because the original list is in another xml
// resource
for(RequirementRelationStatus cl : initialList) {
statusList.add(EcoreUtil.copy(cl));
}
}
return statusList;
}
}
......@@ -23,17 +23,16 @@ import org.fortiss.af3.mira.model.RequirementSpecification;
/**
* Static implementation of {@link RequirementSpecification}
*
*
* @author rosenberger
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: BDB3188D4AAFA6191CAE3FA4B5839CC5
* @ConQAT.Rating YELLOW Hash: 9FC34B7B3E9D8C8C24CB276A0D17BBC6
*/
// TODO: class and methods can be package-private (i.e. remove public)
public class RequirementSpecificationStaticImpl {
/** Return the {@link Requirement} of the {@link RequirementSpecification} */
public static Requirement getRequirement(RequirementSpecification requirementSpecification) {
static Requirement getRequirement(RequirementSpecification requirementSpecification) {
// forward from RequirementSpecification to requirement
if(requirementSpecification.getReference() instanceof ExternalRelation)
......
......@@ -25,7 +25,7 @@ import org.fortiss.af3.mira.model.functional.FormalSpecification;
* @author mou
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 1E5F61E0FE50CAF1A833F6A6D29EE2C7
* @ConQAT.Rating YELLOW Hash: B9B0CE33290A406CF0D5699622D634D1
*/
class RequirementStaticImpl {
......
......@@ -28,30 +28,28 @@ import org.fortiss.af3.mira.model.RequirementsPackage;
/**
* Static implementations for {@link RequirementsContainer}.
*
*
* @author wenwenchen
* @author $Author: hoelzl $
* @version $Rev: 18709 $
* @ConQAT.Rating YELLOW Hash: 85146B85EA7310D6E7DC05A6C39D1985
* @ConQAT.Rating YELLOW Hash: 6339D98739A2520063EF5E43AACFA438
*/
// TODO: class and methods can be package-private (i.e. remove public)
public class RequirementsContainerStaticImpl {
/** Return immediately contained {@link RequirementsPackage} list */
public static EList<RequirementsPackage> getRequirementsPackagesList(
static EList<RequirementsPackage> getRequirementsPackagesList(
RequirementsContainer requirementsContainer) {
return pickInstanceOf(RequirementsPackage.class,
requirementsContainer.getContainedElements());
}
/** Return the {@link Analysis} of the {@link RequirementsContainer} */
public static Analysis getAnalysis(RequirementsContainer requirementsContainer) {
static Analysis getAnalysis(RequirementsContainer requirementsContainer) {
return (Analysis)requirementsContainer.getContainer();
}
/** Return all contained {@link Requirement} List */
public static EList<Requirement>
getRequirementsList(RequirementsContainer requirementsContainer) {
static EList<Requirement> getRequirementsList(RequirementsContainer requirementsContainer) {
return getChildrenWithType(requirementsContainer, Requirement.class);
}
......
......@@ -27,18 +27,16 @@ import org.fortiss.tooling.base.model.element.IHierarchicElement;
/**
* Static implementations for {@link RequirementsContainer}.
*
*
* @author wenwenchen
* @author $Author: hoelzl $
* @version $Rev: 18709 $
* @ConQAT.Rating YELLOW Hash: E6B1204DF69FD27A54CD51484D03D33C
* @ConQAT.Rating YELLOW Hash: CEB6900291B1B6C102BA65E763AE29B8
*/
// TODO: class and methods can be package-private (i.e. remove public)
public class RequirementsPackageStaticImpl {
/** Return the {@link RequirementsContainer} of the given {@link RequirementsPackage} */
public static RequirementsContainer getRequirementsContainer(
RequirementsPackage requirementsPackage) {
static RequirementsContainer getRequirementsContainer(RequirementsPackage requirementsPackage) {
IHierarchicElement currElement = (IHierarchicElement)requirementsPackage.getContainer();
while(!(currElement instanceof RequirementsContainer)) {
currElement = (IHierarchicElement)currElement.getContainer();
......@@ -47,12 +45,12 @@ public class RequirementsPackageStaticImpl {
}
/** Return immediately contained {@link Requirement} list */
public static EList<Requirement> getRequirementsList(RequirementsPackage requirementsPackage) {
static EList<Requirement> getRequirementsList(RequirementsPackage requirementsPackage) {
return pickInstanceOf(Requirement.class, requirementsPackage.getContainedElements());
}
/** Return immediately contained {@link RequirementsPackage} list */
public static EList<RequirementsPackage> getSubPackage(RequirementsPackage requirementsPackage) {
static EList<RequirementsPackage> getSubPackage(RequirementsPackage requirementsPackage) {
return pickInstanceOf(RequirementsPackage.class, requirementsPackage.getContainedElements());
}
......
......@@ -21,17 +21,16 @@ import org.fortiss.af3.mira.model.WordElement;
/**
* Static implementation of {@link WordElement}
*
*
* @author mou
* @author $Author: hoelzl $
* @version $Rev: 4247 $
* @ConQAT.Rating YELLOW Hash: 4B4DE2AA978A7717ED91D92B72298E6C
* @ConQAT.Rating YELLOW Hash: 09A9460BD08471B84E9F683D2DF8853E
*/
// TODO: class and methods can be package-private (i.e. remove public)
public class WordElementStaticImpl {
/** Return text property */
public static String toString(WordElement wordElement) {
static String toString(WordElement wordElement) {
return wordElement.getText();
}
}
......@@ -49,7 +49,7 @@ import org.fortiss.tooling.kernel.model.IProjectRootElement;
/**
* {@link IMigrationProvider} implementation for the {@link Analysis}.
*
*
* @author teufl
* @author $Author$
* @version $Rev$
......@@ -221,8 +221,7 @@ public class AnalysisMigrationProvider implements IMigrationProvider {
RequirementRelation relation = createRequirementRelation();
// Initialize default requirement relation status
if(analysis.getRequirementRelationStatus().size() < 1) {
// TODO (dan) commented out because of compile errors
// analysis.initializeRequirementRelationStatus();
analysis.initializeRequirementRelationStatus();
}
relation.setRequirementRelationStatus(analysis.getRequirementRelationStatus()
.get(0));
......
......@@ -89,7 +89,7 @@ import org.fortiss.tooling.kernel.utils.EcoreUtils;
* @author mou
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: A4DFF3E00B2579FBC98B110856CD229D
* @ConQAT.Rating YELLOW Hash: 0F4392C917CBCC3D0DE6704A9F38CA6C
*/
public class ContextFactory {
......@@ -213,8 +213,7 @@ public class ContextFactory {
EvaluationContext ctx = new EvaluationContext();
handleGeneralInformation(ctx, requirement);
// TODO (dan) commented out because of compile errors
// ctx.set("package", requirement.getRequirementsPackageName());
ctx.set("package", requirement.getRequirementsPackageName());
// evaluate images
ctx.defineContextList("images");
......@@ -245,15 +244,14 @@ public class ContextFactory {
handleExternalRelations(ctx, requirement);
// evaluate safety information
// TODO (dan) commented out because of compile errors
// if(requirement.hasSafetyInformation()) {
// ctx.set("has_safety_information", true);
// ctx.set("safety_requirement_type", requirement.getSafetyRequirementType());
// ctx.set("safety_standard", requirement.getSafetyStandards());
// ctx.set("safety_integrity_level", requirement.getSafetyLevel());
// } else {
// ctx.set("has_safety_information", false);
// }
if(requirement.hasSafetyInformation()) {
ctx.set("has_safety_information", true);
ctx.set("safety_requirement_type", requirement.getSafetyRequirementType());
ctx.set("safety_standard", requirement.getSafetyStandards());
ctx.set("safety_integrity_level", requirement.getSafetyLevel());
} else {
ctx.set("has_safety_information", false);
}
// evaluate comments
ctx.set("comments", requirement.getComment());
......@@ -265,9 +263,8 @@ public class ContextFactory {
* Evaluate the {@link RequirementRelation} to the given {@link EvaluationContext}
*/
private static void handleExternalRelations(EvaluationContext ctx, Requirement requirement) {
// TODO (dan) commented out because of compile errors
// boolean isSafetyRelevant = requirement.isSafetyRelevant();
// ctx.set("is_safety_relevant", isSafetyRelevant);
boolean isSafetyRelevant = requirement.isSafetyRelevant();
ctx.set("is_safety_relevant", isSafetyRelevant);
for(ExternalRelation externalRelation : requirement.getExternalRelation()) {
......@@ -280,8 +277,7 @@ public class ContextFactory {
((INamedElement)targetSpecification).getName());
relationCtx.set("externalRelationTargetType", targetSpecification.eClass().getName());
relationCtx.set("externalRelationComment", externalRelation.getComment());
// TODO (dan) commented out because of compile errors
// relationCtx.set("isSafetyRelevant", isSafetyRelevant);
relationCtx.set("isSafetyRelevant", isSafetyRelevant);
relationCtx.set("externalRelationIsSafetyRelevant",
externalRelation.isSafetyRelatedTrace());
ctx.addContext("externalRelations", relationCtx);
......
......@@ -18,7 +18,6 @@ $Id$
package org.fortiss.af3.mira.utils;
import static org.eclipse.emf.ecore.util.EcoreUtil.copy;
import static org.fortiss.af3.mira.utils.MiraUtils.initializeRequirementRelationStatus;
import static org.fortiss.af3.mira.utils.MiraUtils.loadChecklist;
import java.util.ArrayList;
......@@ -83,7 +82,7 @@ import org.fortiss.af3.mira.model.verification.CheckList;
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 47E9A365F612EC90F45D67BCC81C5F68
* @ConQAT.Rating YELLOW Hash: 6F396AE47551939A8C9BB2B38C7F6BCC
*/
public final class MiraModelElementFactory {
......@@ -92,7 +91,7 @@ public final class MiraModelElementFactory {
Analysis analysis = MiraFactory.eINSTANCE.createAnalysis();
// Initialize default requirement relation status
initializeRequirementRelationStatus(analysis);
analysis.initializeRequirementRelationStatus();
return analysis;
}
......
......@@ -20,24 +20,20 @@ package org.fortiss.af3.mira.utils;
import static org.conqat.lib.commons.string.StringUtils.isEmpty;
import static org.eclipse.emf.ecore.util.EcoreUtil.delete;
import static org.fortiss.tooling.kernel.utils.EMFResourceUtils.loadModelFromFile;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.generalizeList;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.pickFirstInstanceOf;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.pickInstanceOf;
import static org.fortiss.tooling.kernel.utils.KernelModelElementUtils.getRootElement;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import org.apache.commons.lang.StringUtils;
import org.eclipse.emf.common.util.BasicEList;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.fortiss.af3.component.model.Component;
import org.fortiss.af3.component.utils.ComponentArchitectureUtils;
import org.fortiss.af3.expression.model.DataDictionary;
import org.fortiss.af3.mira.AF3MiraActivator;
import org.fortiss.af3.mira.command.DeleteExternalRelationsFromRequirementCommand;
import org.fortiss.af3.mira.command.DeleteRequirementRelationsFromRequirementCommand;
......@@ -52,10 +48,8 @@ import org.fortiss.af3.mira.model.Requirement;
import org.fortiss.af3.mira.model.RequirementRelation;
import org.fortiss.af3.mira.model.RequirementsContainer;
import org.fortiss.af3.mira.model.RequirementsPackage;
import org.fortiss.af3.mira.model.functional.FormalSpecification;
import org.fortiss.af3.mira.model.glossary.Glossary;
import org.fortiss.af3.mira.model.glossary.GlossaryEntry;
import org.fortiss.af3.mira.model.relations.RequirementRelationStatus;
import org.fortiss.af3.mira.model.requirementSource.ExternalSystem;
import org.fortiss.af3.mira.model.requirementSource.RequirementDocument;
import org.fortiss.af3.mira.model.requirementSource.RequirementSource;
......@@ -65,10 +59,6 @@ import org.fortiss.af3.mira.model.usecase.Actor;
import org.fortiss.af3.mira.model.usecase.UseCase;
import org.fortiss.af3.mira.model.verification.CheckList;
import org.fortiss.af3.project.model.FileProject;
import org.fortiss.af3.project.model.typesystem.FunctionCallBase;
import org.fortiss.af3.project.model.typesystem.IFunctionDefinition;
import org.fortiss.af3.project.model.typesystem.IType;
import org.fortiss.af3.project.model.typesystem.ITypeDefinition;
import org.fortiss.tooling.base.model.element.IHierarchicElement;
import org.fortiss.tooling.base.model.element.IModelElement;
import org.fortiss.tooling.base.model.element.IModelElementReference;
......@@ -76,12 +66,11 @@ import org.fortiss.tooling.kernel.service.ICommandStackService;
/**
* Utility methods for accessing Mira model.
* TODO Improve the code by moving methods to corresponding *StaticImpl classes (Issue #1589)
*
*
* @author mou
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: BBD48271A83A899360E243C7674DFE44
* @ConQAT.Rating YELLOW Hash: 1F66C0D43465ACC088DD99E5EA62F987
*/
public class MiraUtils {
......@@ -154,7 +143,7 @@ public class MiraUtils {
public static List<String> getRequirementNameList(List<Requirement> requirementList) {
ArrayList<String> nameList = new ArrayList<String>();
for(Requirement r : requirementList) {
nameList.add(getRequirementName(r));
nameList.add(r.getRequirementName());
}
return nameList;
}
......@@ -173,9 +162,9 @@ public class MiraUtils {
if(requirementList.size() < 1) {
return "";
}
String names = getRequirementName(requirementList.get(0));
String names = requirementList.get(0).getRequirementName();
for(int i = 1; i < requirementList.size(); i++) {
names += (delimiter + getRequirementName(requirementList.get(i)));
names += (delimiter + requirementList.get(i).getRequirementName());
}
return names;
}
......@@ -355,93 +344,6 @@ public class MiraUtils {
return org.conqat.lib.commons.string.StringUtils.concat(infos, ",");
}
/**
* Get a {@link RequirementsPackage}s name string, which the given {@link Requirement} contains
*
* @param req
* the requirement
* @return {@link RequirementsPackage}s name string
*/
public static String getRequirementsPackageNameFor(Requirement req) {
String name = "";
ArrayList<String> nameList = new ArrayList<String>();
RequirementsPackage rePackage = req.getRequirementsPackage();
if(rePackage == null) {
return "";
}
nameList.add(rePackage.getName());
while(rePackage.getContainer() instanceof RequirementsPackage) {
rePackage = (RequirementsPackage)rePackage.getContainer();
nameList.add(rePackage.getName());
}
for(int i = nameList.size() - 1; i > 0; i--) {
name += nameList.get(i) + ".";
}
name += nameList.get(0);
return name;