Commit 4658089e authored by Dominique Marcadet's avatar Dominique Marcadet

Merge branch '65-code-of-doiimpl-getnamespace-deleted-by-last-emf-code-generation' into 'master'

Resolve "code of DOIImpl.getNamespace() deleted by last EMF code generation"

Closes #65

See merge request !63
parents 0b651ac3 0b917444
Pipeline #5291 passed with stages
in 46 seconds
...@@ -35,6 +35,7 @@ import org.eclipse.emf.ecore.util.EcoreUtil; ...@@ -35,6 +35,7 @@ import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.ecore.util.InternalEList; import org.eclipse.emf.ecore.util.InternalEList;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.AnyLN; 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.DAI;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.DO; import fr.centralesupelec.edf.riseclipse.iec61850.scl.DO;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.DOI; import fr.centralesupelec.edf.riseclipse.iec61850.scl.DOI;
...@@ -593,13 +594,50 @@ public class DOIImpl extends UnNamingImpl implements DOI { ...@@ -593,13 +594,50 @@ public class DOIImpl extends UnNamingImpl implements DOI {
/** /**
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
* <!-- end-user-doc --> * <!-- end-user-doc -->
* @generated * @generated NOT
*/ */
@Override @Override
public String getNamespace() { public String getNamespace() {
// TODO: implement this method //@formatter:off
// Ensure that you remove @generated or mark it @generated NOT List< DAI > ldNsDai =
throw new UnsupportedOperationException(); 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
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment