Skip to content
Snippets Groups Projects
Commit 0b917444 authored by Dominique Marcadet's avatar Dominique Marcadet
Browse files

put back getNamespace() in DOIImpl

parent 56ebb322
No related branches found
No related tags found
1 merge request!63Resolve "code of DOIImpl.getNamespace() deleted by last EMF code generation"
Pipeline #5167 passed
......@@ -35,6 +35,7 @@ import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.ecore.util.InternalEList;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.AnyLN;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.DA;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.DAI;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.DO;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.DOI;
......@@ -593,13 +594,50 @@ public class DOIImpl extends UnNamingImpl implements DOI {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @generated NOT
*/
@Override
public String getNamespace() {
// TODO: implement this method
// Ensure that you remove @generated or mark it @generated NOT
throw new UnsupportedOperationException();
//@formatter:off
List< DAI > ldNsDai =
getDAI()
.stream()
.filter( dai -> "dataNs".equals( dai.getName() ))
.collect( Collectors.toList() );
if( ldNsDai.size() == 1 ) {
if(( ldNsDai.get( 0 ).getVal().size() == 1 )
&& ( ldNsDai.get( 0 ).getVal().get( 0 ).getValue() != null )
&& ( ldNsDai.get( 0 ).getVal().get( 0 ).getValue().length() != 0 )) {
return ldNsDai.get( 0 ).getVal().get( 0 ).getValue();
}
if(( ldNsDai.get( 0 ).getRefersToAbstractDataAttribute() != null )
&& ( ldNsDai.get( 0 ).getRefersToAbstractDataAttribute().getVal().size() == 1 )
&& ( ldNsDai.get( 0 ).getRefersToAbstractDataAttribute().getVal().get( 0 ).getValue() != null )
&& ( ldNsDai.get( 0 ).getRefersToAbstractDataAttribute().getVal().get( 0 ).getValue().length() != 0 )) {
return ldNsDai.get( 0 ).getRefersToAbstractDataAttribute().getVal().get( 0 ).getValue();
}
}
if( getRefersToDO() != null ) {
List< DA > lnNsDa =
getRefersToDO()
.getRefersToDOType()
.getDA()
.stream()
.filter( da -> "dataNs".equals( da.getName() ))
.collect( Collectors.toList() );
if( lnNsDa.size() == 1 ) {
if(( lnNsDa.get( 0 ).getVal().size() == 1 )
&& ( lnNsDa.get( 0 ).getVal().get( 0 ).getValue() != null )
&& ( lnNsDa.get( 0 ).getVal().get( 0 ).getValue().length() != 0 )) {
return lnNsDa.get( 0 ).getVal().get( 0 ).getValue();
}
}
}
if( getParentAnyLN() == null ) return null;
return getParentAnyLN().getNamespace();
//@formatter:on
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment