Commit 13c6c2e6 authored by Dominique Marcadet's avatar Dominique Marcadet

move finders from NS to ResourceSet

parent 758fa2d1
......@@ -1271,30 +1271,6 @@
<details key="name" value="tNS"/>
<details key="kind" value="elementOnly"/>
</eAnnotations>
<eOperations name="findCDC" eType="#//CDC">
<eParameters name="cDCName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eParameters name="console" eType="#//IRiseClipseConsole"/>
</eOperations>
<eOperations name="findPresenceCondition" eType="#//PresenceCondition">
<eParameters name="presenceConditionName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eParameters name="console" eType="#//IRiseClipseConsole"/>
</eOperations>
<eOperations name="findFunctionalConstraint" eType="#//FunctionalConstraint">
<eParameters name="functionalConstraintAbbreviation" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eParameters name="console" eType="#//IRiseClipseConsole"/>
</eOperations>
<eOperations name="findEnumeration" eType="#//Enumeration">
<eParameters name="enumerationName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eParameters name="console" eType="#//IRiseClipseConsole"/>
</eOperations>
<eOperations name="findBasicType" eType="#//BasicType">
<eParameters name="basicTypeName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eParameters name="console" eType="#//IRiseClipseConsole"/>
</eOperations>
<eOperations name="findConstructedAttribute" eType="#//ConstructedAttribute">
<eParameters name="constructedAttributeName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eParameters name="console" eType="#//IRiseClipseConsole"/>
</eOperations>
<eStructuralFeatures xsi:type="ecore:EReference" name="changes" ordered="false"
eType="#//Changes" unsettable="true" containment="true" resolveProxies="false"
eOpposite="#//Changes/parentNS">
......
......@@ -330,30 +330,6 @@
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference nsd.ecore#//NS/cDCs"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference nsd.ecore#//NS/lNClasses"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference nsd.ecore#//NS/referredByDependsOn"/>
<genOperations ecoreOperation="nsd.ecore#//NS/findCDC">
<genParameters ecoreParameter="nsd.ecore#//NS/findCDC/cDCName"/>
<genParameters ecoreParameter="nsd.ecore#//NS/findCDC/console"/>
</genOperations>
<genOperations ecoreOperation="nsd.ecore#//NS/findPresenceCondition">
<genParameters ecoreParameter="nsd.ecore#//NS/findPresenceCondition/presenceConditionName"/>
<genParameters ecoreParameter="nsd.ecore#//NS/findPresenceCondition/console"/>
</genOperations>
<genOperations ecoreOperation="nsd.ecore#//NS/findFunctionalConstraint">
<genParameters ecoreParameter="nsd.ecore#//NS/findFunctionalConstraint/functionalConstraintAbbreviation"/>
<genParameters ecoreParameter="nsd.ecore#//NS/findFunctionalConstraint/console"/>
</genOperations>
<genOperations ecoreOperation="nsd.ecore#//NS/findEnumeration">
<genParameters ecoreParameter="nsd.ecore#//NS/findEnumeration/enumerationName"/>
<genParameters ecoreParameter="nsd.ecore#//NS/findEnumeration/console"/>
</genOperations>
<genOperations ecoreOperation="nsd.ecore#//NS/findBasicType">
<genParameters ecoreParameter="nsd.ecore#//NS/findBasicType/basicTypeName"/>
<genParameters ecoreParameter="nsd.ecore#//NS/findBasicType/console"/>
</genOperations>
<genOperations ecoreOperation="nsd.ecore#//NS/findConstructedAttribute">
<genParameters ecoreParameter="nsd.ecore#//NS/findConstructedAttribute/constructedAttributeName"/>
<genParameters ecoreParameter="nsd.ecore#//NS/findConstructedAttribute/console"/>
</genOperations>
</genClasses>
<genClasses ecoreClass="nsd.ecore#//NSDoc">
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference nsd.ecore#//NSDoc/doc"/>
......
......@@ -19,7 +19,6 @@
*/
package fr.centralesupelec.edf.riseclipse.iec61850.nsd;
import fr.centralesupelec.edf.riseclipse.util.IRiseClipseConsole;
import org.eclipse.emf.common.util.EList;
/**
......@@ -610,53 +609,4 @@ public interface NS extends Copyrighted, AgNSIdentification, AgUML, AgNSdesc {
*/
boolean isSetReferredByDependsOn();
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @model consoleType="fr.centralesupelec.edf.riseclipse.iec61850.nsd.IRiseClipseConsole"
* @generated
*/
CDC findCDC( String cDCName, IRiseClipseConsole console );
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @model consoleType="fr.centralesupelec.edf.riseclipse.iec61850.nsd.IRiseClipseConsole"
* @generated
*/
PresenceCondition findPresenceCondition( String presenceConditionName, IRiseClipseConsole console );
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @model consoleType="fr.centralesupelec.edf.riseclipse.iec61850.nsd.IRiseClipseConsole"
* @generated
*/
FunctionalConstraint findFunctionalConstraint( String functionalConstraintAbbreviation,
IRiseClipseConsole console );
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @model consoleType="fr.centralesupelec.edf.riseclipse.iec61850.nsd.IRiseClipseConsole"
* @generated
*/
Enumeration findEnumeration( String enumerationName, IRiseClipseConsole console );
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @model consoleType="fr.centralesupelec.edf.riseclipse.iec61850.nsd.IRiseClipseConsole"
* @generated
*/
BasicType findBasicType( String basicTypeName, IRiseClipseConsole console );
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @model consoleType="fr.centralesupelec.edf.riseclipse.iec61850.nsd.IRiseClipseConsole"
* @generated
*/
ConstructedAttribute findConstructedAttribute( String constructedAttributeName, IRiseClipseConsole console );
} // NS
......@@ -4695,60 +4695,6 @@ public interface NsdPackage extends EPackage {
*/
int NS___BUILD_EXPLICIT_LINKS__IRISECLIPSECONSOLE_BOOLEAN = COPYRIGHTED___BUILD_EXPLICIT_LINKS__IRISECLIPSECONSOLE_BOOLEAN;
/**
* The operation id for the '<em>Find CDC</em>' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int NS___FIND_CDC__STRING_IRISECLIPSECONSOLE = COPYRIGHTED_OPERATION_COUNT + 0;
/**
* The operation id for the '<em>Find Presence Condition</em>' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int NS___FIND_PRESENCE_CONDITION__STRING_IRISECLIPSECONSOLE = COPYRIGHTED_OPERATION_COUNT + 1;
/**
* The operation id for the '<em>Find Functional Constraint</em>' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int NS___FIND_FUNCTIONAL_CONSTRAINT__STRING_IRISECLIPSECONSOLE = COPYRIGHTED_OPERATION_COUNT + 2;
/**
* The operation id for the '<em>Find Enumeration</em>' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int NS___FIND_ENUMERATION__STRING_IRISECLIPSECONSOLE = COPYRIGHTED_OPERATION_COUNT + 3;
/**
* The operation id for the '<em>Find Basic Type</em>' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int NS___FIND_BASIC_TYPE__STRING_IRISECLIPSECONSOLE = COPYRIGHTED_OPERATION_COUNT + 4;
/**
* The operation id for the '<em>Find Constructed Attribute</em>' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int NS___FIND_CONSTRUCTED_ATTRIBUTE__STRING_IRISECLIPSECONSOLE = COPYRIGHTED_OPERATION_COUNT + 5;
/**
* The number of operations of the '<em>NS</em>' class.
* <!-- begin-user-doc -->
......@@ -4756,7 +4702,7 @@ public interface NsdPackage extends EPackage {
* @generated
* @ordered
*/
int NS_OPERATION_COUNT = COPYRIGHTED_OPERATION_COUNT + 6;
int NS_OPERATION_COUNT = COPYRIGHTED_OPERATION_COUNT + 0;
/**
* The feature id for the '<em><b>Line Number</b></em>' attribute.
......@@ -9454,66 +9400,6 @@ public interface NsdPackage extends EPackage {
*/
EReference getNS_ReferredByDependsOn();
/**
* Returns the meta object for the '{@link fr.centralesupelec.edf.riseclipse.iec61850.nsd.NS#findCDC(java.lang.String, fr.centralesupelec.edf.riseclipse.util.IRiseClipseConsole) <em>Find CDC</em>}' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the '<em>Find CDC</em>' operation.
* @see fr.centralesupelec.edf.riseclipse.iec61850.nsd.NS#findCDC(java.lang.String, fr.centralesupelec.edf.riseclipse.util.IRiseClipseConsole)
* @generated
*/
EOperation getNS__FindCDC__String_IRiseClipseConsole();
/**
* Returns the meta object for the '{@link fr.centralesupelec.edf.riseclipse.iec61850.nsd.NS#findPresenceCondition(java.lang.String, fr.centralesupelec.edf.riseclipse.util.IRiseClipseConsole) <em>Find Presence Condition</em>}' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the '<em>Find Presence Condition</em>' operation.
* @see fr.centralesupelec.edf.riseclipse.iec61850.nsd.NS#findPresenceCondition(java.lang.String, fr.centralesupelec.edf.riseclipse.util.IRiseClipseConsole)
* @generated
*/
EOperation getNS__FindPresenceCondition__String_IRiseClipseConsole();
/**
* Returns the meta object for the '{@link fr.centralesupelec.edf.riseclipse.iec61850.nsd.NS#findFunctionalConstraint(java.lang.String, fr.centralesupelec.edf.riseclipse.util.IRiseClipseConsole) <em>Find Functional Constraint</em>}' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the '<em>Find Functional Constraint</em>' operation.
* @see fr.centralesupelec.edf.riseclipse.iec61850.nsd.NS#findFunctionalConstraint(java.lang.String, fr.centralesupelec.edf.riseclipse.util.IRiseClipseConsole)
* @generated
*/
EOperation getNS__FindFunctionalConstraint__String_IRiseClipseConsole();
/**
* Returns the meta object for the '{@link fr.centralesupelec.edf.riseclipse.iec61850.nsd.NS#findEnumeration(java.lang.String, fr.centralesupelec.edf.riseclipse.util.IRiseClipseConsole) <em>Find Enumeration</em>}' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the '<em>Find Enumeration</em>' operation.
* @see fr.centralesupelec.edf.riseclipse.iec61850.nsd.NS#findEnumeration(java.lang.String, fr.centralesupelec.edf.riseclipse.util.IRiseClipseConsole)
* @generated
*/
EOperation getNS__FindEnumeration__String_IRiseClipseConsole();
/**
* Returns the meta object for the '{@link fr.centralesupelec.edf.riseclipse.iec61850.nsd.NS#findBasicType(java.lang.String, fr.centralesupelec.edf.riseclipse.util.IRiseClipseConsole) <em>Find Basic Type</em>}' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the '<em>Find Basic Type</em>' operation.
* @see fr.centralesupelec.edf.riseclipse.iec61850.nsd.NS#findBasicType(java.lang.String, fr.centralesupelec.edf.riseclipse.util.IRiseClipseConsole)
* @generated
*/
EOperation getNS__FindBasicType__String_IRiseClipseConsole();
/**
* Returns the meta object for the '{@link fr.centralesupelec.edf.riseclipse.iec61850.nsd.NS#findConstructedAttribute(java.lang.String, fr.centralesupelec.edf.riseclipse.util.IRiseClipseConsole) <em>Find Constructed Attribute</em>}' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the '<em>Find Constructed Attribute</em>' operation.
* @see fr.centralesupelec.edf.riseclipse.iec61850.nsd.NS#findConstructedAttribute(java.lang.String, fr.centralesupelec.edf.riseclipse.util.IRiseClipseConsole)
* @generated
*/
EOperation getNS__FindConstructedAttribute__String_IRiseClipseConsole();
/**
* Returns the meta object for class '{@link fr.centralesupelec.edf.riseclipse.iec61850.nsd.NSDoc <em>NS Doc</em>}'.
* <!-- begin-user-doc -->
......@@ -12559,59 +12445,6 @@ public interface NsdPackage extends EPackage {
*/
EReference NS__REFERRED_BY_DEPENDS_ON = eINSTANCE.getNS_ReferredByDependsOn();
/**
* The meta object literal for the '<em><b>Find CDC</b></em>' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EOperation NS___FIND_CDC__STRING_IRISECLIPSECONSOLE = eINSTANCE.getNS__FindCDC__String_IRiseClipseConsole();
/**
* The meta object literal for the '<em><b>Find Presence Condition</b></em>' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EOperation NS___FIND_PRESENCE_CONDITION__STRING_IRISECLIPSECONSOLE = eINSTANCE
.getNS__FindPresenceCondition__String_IRiseClipseConsole();
/**
* The meta object literal for the '<em><b>Find Functional Constraint</b></em>' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EOperation NS___FIND_FUNCTIONAL_CONSTRAINT__STRING_IRISECLIPSECONSOLE = eINSTANCE
.getNS__FindFunctionalConstraint__String_IRiseClipseConsole();
/**
* The meta object literal for the '<em><b>Find Enumeration</b></em>' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EOperation NS___FIND_ENUMERATION__STRING_IRISECLIPSECONSOLE = eINSTANCE
.getNS__FindEnumeration__String_IRiseClipseConsole();
/**
* The meta object literal for the '<em><b>Find Basic Type</b></em>' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EOperation NS___FIND_BASIC_TYPE__STRING_IRISECLIPSECONSOLE = eINSTANCE
.getNS__FindBasicType__String_IRiseClipseConsole();
/**
* The meta object literal for the '<em><b>Find Constructed Attribute</b></em>' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EOperation NS___FIND_CONSTRUCTED_ATTRIBUTE__STRING_IRISECLIPSECONSOLE = eINSTANCE
.getNS__FindConstructedAttribute__String_IRiseClipseConsole();
/**
* The meta object literal for the '{@link fr.centralesupelec.edf.riseclipse.iec61850.nsd.impl.NSDocImpl <em>NS Doc</em>}' class.
* <!-- begin-user-doc -->
......
......@@ -3575,12 +3575,14 @@ public class DataAttributeImpl extends DocumentedClassImpl implements DataAttrib
if( super.buildExplicitLinks( console, forceUpdate ) ) return true;
NS ns = getParentCDC().getParentCDCs().getParentNS();
NsdResourceSetImpl rs = getResourceSet();
if( rs == null ) return false;
String messagePrefix = "[NSD links] while resolving link from DataAttribute (name: " + getName()
+ ", NS id: " + ns.getId() + ", line: " + getLineNumber() + "): ";
if( isSetFc() ) {
FunctionalConstraint foundFC = ns.findFunctionalConstraint( getFc(), console );
FunctionalConstraint foundFC = rs.findFunctionalConstraint( getFc(), getNsIdentification(), console );
if( foundFC == null ) {
console.warning( messagePrefix + "FunctionalConstraint (abbreviation: " + getFc() + ") not found" );
......@@ -3596,7 +3598,7 @@ public class DataAttributeImpl extends DocumentedClassImpl implements DataAttrib
}
if( isSetPresCond() ) {
PresenceCondition foundPC = ns.findPresenceCondition( getPresCond(), console );
PresenceCondition foundPC = rs.findPresenceCondition( getPresCond(), getNsIdentification(), console );
if( foundPC == null ) {
console.warning( messagePrefix + "PresenceCondition (name: " + getPresCond() + ") not found" );
......@@ -3650,7 +3652,7 @@ public class DataAttributeImpl extends DocumentedClassImpl implements DataAttrib
if( isSetType() ) {
switch( getTypeKind().getValue() ) {
case DefinedAttributeTypeKind.BASIC_VALUE:
BasicType foundBT = ns.findBasicType( getType(), console );
BasicType foundBT = rs.findBasicType( getType(), getNsIdentification(), console );
if( foundBT == null ) {
console.warning( messagePrefix + "BasicType (name: " + getType() + ") not found" );
......@@ -3664,7 +3666,7 @@ public class DataAttributeImpl extends DocumentedClassImpl implements DataAttrib
}
break;
case DefinedAttributeTypeKind.CONSTRUCTED_VALUE:
ConstructedAttribute foundCA = ns.findConstructedAttribute( getType(), console );
ConstructedAttribute foundCA = rs.findConstructedAttribute( getType(), getNsIdentification(), console );
if( foundCA == null ) {
console.warning( messagePrefix + "ConstructedAttribute (name: " + getType() + ") not found" );
......@@ -3680,7 +3682,7 @@ public class DataAttributeImpl extends DocumentedClassImpl implements DataAttrib
}
break;
case DefinedAttributeTypeKind.ENUMERATED_VALUE:
Enumeration foundEn = ns.findEnumeration( getType(), console );
Enumeration foundEn = rs.findEnumeration( getType(), getNsIdentification(), console );
if( foundEn == null ) {
console.warning( messagePrefix + "Enumeration (name: " + getType() + ") not found" );
......
......@@ -2188,12 +2188,14 @@ public class DataObjectImpl extends DocumentedClassImpl implements DataObject {
if( super.buildExplicitLinks( console, forceUpdate ) ) return true;
NS ns = getParentAnyLNClass().getParentLNClasses().getParentNS();
NsdResourceSetImpl rs = getResourceSet();
if( rs == null ) return false;
String messagePrefix = "[NSD links] while resolving link from DataObject (name: " + getName()
+ ", NS id: " + ns.getId() + ", line: " + getLineNumber() + "): ";
if( isSetType() ) {
CDC foundCDC = ns.findCDC( getType(), console );
CDC foundCDC = rs.findCDC( getType(), getNsIdentification(), console );
if( foundCDC == null ) {
console.warning( messagePrefix + "CDC (name: " + getType() + ") not found" );
......@@ -2207,7 +2209,7 @@ public class DataObjectImpl extends DocumentedClassImpl implements DataObject {
}
if( isSetPresCond() ) {
PresenceCondition foundPC = ns.findPresenceCondition( getPresCond(), console );
PresenceCondition foundPC = rs.findPresenceCondition( getPresCond(), getNsIdentification(), console );
if( foundPC == null ) {
console.warning( messagePrefix + "PresenceCondition (name: " + getPresCond() + ") not found" );
......@@ -2221,7 +2223,7 @@ public class DataObjectImpl extends DocumentedClassImpl implements DataObject {
}
if( isSetDsPresCond() ) {
PresenceCondition foundPC = ns.findPresenceCondition( getDsPresCond(), console );
PresenceCondition foundPC = rs.findPresenceCondition( getDsPresCond(), getNsIdentification(), console );
if( foundPC == null ) {
console.warning( messagePrefix + "PresenceCondition (name: " + getDsPresCond() + ") not found" );
}
......
......@@ -26,6 +26,7 @@ import fr.centralesupelec.edf.riseclipse.iec61850.nsd.Literal;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.NS;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.NsdPackage;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.util.NsIdentification;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.util.NsdResourceSetImpl;
import fr.centralesupelec.edf.riseclipse.util.IRiseClipseConsole;
import java.util.Collection;
......@@ -787,12 +788,14 @@ public class EnumerationImpl extends TitledClassImpl implements Enumeration {
if( super.buildExplicitLinks( console, forceUpdate ) ) return true;
NS ns = getParentEnumerations().getParentNS();
NsdResourceSetImpl rs = getResourceSet();
if( rs == null ) return false;
String messagePrefix = "[NSD links] while resolving link from Enumeration (name: " + getName()
+ ", NS id: " + ns.getId() + ", line: " + getLineNumber() + "): ";
if( isSetInheritedFrom() ) {
Enumeration foundBase = ns.findEnumeration( getInheritedFrom(), console );
Enumeration foundBase = rs.findEnumeration( getInheritedFrom(), getNsIdentification(), console );
if( foundBase == null ) {
console.warning( messagePrefix + "Enumeration (name: " + getInheritedFrom() + ") not found" );
}
......
......@@ -23,29 +23,22 @@ import fr.centralesupelec.edf.riseclipse.iec61850.nsd.Abbreviations;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.AgNSIdentification;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.AgNSdesc;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.AgUML;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.BasicType;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.BasicTypes;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.CDC;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.CDCs;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.Changes;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.ConstructedAttribute;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.ConstructedAttributes;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.DependsOn;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.Doc;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.Enumeration;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.Enumerations;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.FunctionalConstraint;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.FunctionalConstraints;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.LNClasses;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.NS;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.NsdPackage;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.PresenceCondition;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.PresenceConditions;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.PubStage;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.util.NsIdentification;
import fr.centralesupelec.edf.riseclipse.iec61850.nsd.util.NsdResourceSetImpl;
import fr.centralesupelec.edf.riseclipse.util.IRiseClipseConsole;
import java.lang.reflect.InvocationTargetException;
import java.util.Collection;
import javax.xml.datatype.XMLGregorianCalendar;
......@@ -1724,147 +1717,6 @@ public class NSImpl extends CopyrightedImpl implements NS {
return referredByDependsOn != null && ( ( InternalEList.Unsettable< ? > ) referredByDependsOn ).isSet();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
*/
@Override
public CDC findCDC( String cDCName, IRiseClipseConsole console ) {
if( isSetCDCs() ) {
CDC found = getCDCs().getCDC().stream().filter( cdc -> cdc.getName().equals( cDCName ) ).findAny()
.orElse( null );
if( found != null ) return found;
}
// Look for in NS referred by DependsOn
// Warning: NS referred by DependsOn may not be loaded
if( isSetDependsOn() && ( getDependsOn().isSetRefersToNS() ) ) {
getDependsOn().buildExplicitLinks( console, false );
return getDependsOn().getRefersToNS().findCDC( cDCName, console );
}
return null;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
*/
@Override
public PresenceCondition findPresenceCondition( String presenceConditionName, IRiseClipseConsole console ) {
if( isSetPresenceConditions() ) {
PresenceCondition found = getPresenceConditions().getPresenceCondition().stream()
.filter( cond -> cond.getName().equals( presenceConditionName ) ).findAny().orElse( null );
if( found != null ) return found;
}
// Look for in NS referred by DependsOn
// Warning: NS referred by DependsOn may not be loaded
if( isSetDependsOn() && ( getDependsOn().isSetRefersToNS() ) ) {
getDependsOn().buildExplicitLinks( console, false );
return getDependsOn().getRefersToNS().findPresenceCondition( presenceConditionName, console );
}
return null;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
*/
@Override
public FunctionalConstraint findFunctionalConstraint( String functionalConstraintAbbreviation,
IRiseClipseConsole console ) {
if( isSetFunctionalConstraints() ) {
FunctionalConstraint found = getFunctionalConstraints().getFunctionalConstraint().stream()
.filter( fc -> fc.getAbbreviation().equals( functionalConstraintAbbreviation ) ).findAny()
.orElse( null );
if( found != null ) return found;
}
// Look for in NS referred by DependsOn
// Warning: NS referred by DependsOn may not be loaded
if( isSetDependsOn() && ( getDependsOn().isSetRefersToNS() ) ) {
getDependsOn().buildExplicitLinks( console, false );
return getDependsOn().getRefersToNS().findFunctionalConstraint( functionalConstraintAbbreviation, console );
}
return null;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
*/
@Override
public Enumeration findEnumeration( String enumerationName, IRiseClipseConsole console ) {
if( isSetEnumerations() ) {
Enumeration found = getEnumerations().getEnumeration().stream()
.filter( en -> en.getName().equals( enumerationName ) ).findAny().orElse( null );
if( found != null ) return found;
}
// Look for in NS referred by DependsOn
// Warning: NS referred by DependsOn may not be loaded
if( isSetDependsOn() && ( getDependsOn().isSetRefersToNS() ) ) {
getDependsOn().buildExplicitLinks( console, false );
return getDependsOn().getRefersToNS().findEnumeration( enumerationName, console );
}
return null;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
*/
@Override
public BasicType findBasicType( String basicTypeName, IRiseClipseConsole console ) {
if( isSetBasicTypes() ) {
BasicType found = getBasicTypes().getBasicType().stream()
.filter( bt -> bt.getName().equals( basicTypeName ) ).findAny().orElse( null );
if( found != null ) return found;
}
// Look for in NS referred by DependsOn
// Warning: NS referred by DependsOn may not be loaded
if( isSetDependsOn() && ( getDependsOn().isSetRefersToNS() ) ) {
getDependsOn().buildExplicitLinks( console, false );
return getDependsOn().getRefersToNS().findBasicType( basicTypeName, console );
}
return null;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
*/
@Override
public ConstructedAttribute findConstructedAttribute( String constructedAttributeName,
IRiseClipseConsole console ) {
if( isSetConstructedAttributes() ) {
ConstructedAttribute found = getConstructedAttributes().getConstructedAttribute().stream()
.filter( ca -> ca.getName().equals( constructedAttributeName ) ).findAny().orElse( null );
if( found != null ) return found;
}
// Look for in NS referred by DependsOn
// Warning: NS referred by DependsOn may not be loaded
if( isSetDependsOn() && ( getDependsOn().isSetRefersToNS() ) ) {
getDependsOn().buildExplicitLinks( console, false );
return getDependsOn().getRefersToNS().findConstructedAttribute( constructedAttributeName, console );
}
return null;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
......@@ -2841,30 +2693,6 @@ public class NSImpl extends CopyrightedImpl implements NS {
return super.eDerivedStructuralFeatureID( baseFeatureID, baseClass );
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eInvoke( int operationID, EList< ? > arguments ) throws InvocationTargetException {
switch( operationID ) {
case NsdPackage.NS___FIND_CDC__STRING_IRISECLIPSECONSOLE:
return findCDC( ( String ) arguments.get( 0 ), ( IRiseClipseConsole ) arguments.get( 1 ) );
case NsdPackage.NS___FIND_PRESENCE_CONDITION__STRING_IRISECLIPSECONSOLE:
return findPresenceCondition( ( String ) arguments.get( 0 ), ( IRiseClipseConsole ) arguments.get( 1 ) );
case NsdPackage.NS___FIND_FUNCTIONAL_CONSTRAINT__STRING_IRISECLIPSECONSOLE:
return findFunctionalConstraint( ( String ) arguments.get( 0 ), ( IRiseClipseConsole ) arguments.get( 1 ) );
case NsdPackage.NS___FIND_ENUMERATION__STRING_IRISECLIPSECONSOLE:
return findEnumeration( ( String ) arguments.get( 0 ), ( IRiseClipseConsole ) arguments.get( 1 ) );
case NsdPackage.NS___FIND_BASIC_TYPE__STRING_IRISECLIPSECONSOLE:
return findBasicType( ( String ) arguments.get( 0 ), ( IRiseClipseConsole ) arguments.get( 1 ) );
case NsdPackage.NS___FIND_CONSTRUCTED_ATTRIBUTE__STRING_IRISECLIPSECONSOLE:
return findConstructedAttribute( ( String ) arguments.get( 0 ), ( IRiseClipseConsole ) arguments.get( 1 ) );
}
return super.eInvoke( operationID, arguments );
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
......