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

Fatal exception if no SCL root element

parent af7eb07b
No related branches found
No related tags found
1 merge request!43Resolve "add link LNode -> LNodeType"
......@@ -33,14 +33,18 @@ import fr.centralesupelec.edf.riseclipse.iec61850.scl.LN;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.SCL;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.SclObject;
import fr.centralesupelec.edf.riseclipse.util.IRiseClipseConsole;
import fr.centralesupelec.edf.riseclipse.util.RiseClipseFatalException;
public class SclUtilities {
public static SCL getSCL( SclObject object ) {
public static @NonNull SCL getSCL( SclObject object ) {
EObject scl = object;
while(( scl != null ) && ! ( scl instanceof SCL )) {
scl = scl.eContainer();
}
if( scl == null ) {
throw new RiseClipseFatalException( "root container is not SCL", null );
}
return ( SCL ) scl;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment