Commit 51b20621 authored by Dominique Marcadet's avatar Dominique Marcadet

add an hidden --display-nsd-messages option

parent b67cce1d
......@@ -77,6 +77,7 @@ public class RiseClipseValidatorSCL {
boolean makeExplicitLinks = false;
boolean useColor = false;
boolean displayCopyright = true;
boolean displayNsdMessages = false;
int consoleLevel = IRiseClipseConsole.WARNING_LEVEL;
......@@ -102,6 +103,9 @@ public class RiseClipseValidatorSCL {
else if( "--do-not-display-copyright".equals( args[i] ) ) {
displayCopyright = false;
}
else if( "--display-nsd-messages".equals( args[i] ) ) {
displayNsdMessages = true;
}
else {
console = new TextRiseClipseConsole( useColor );
console.error( "Unrecognized option " + args[i] );
......@@ -138,7 +142,7 @@ public class RiseClipseValidatorSCL {
}
}
prepare( oclFiles, nsdFiles );
prepare( oclFiles, nsdFiles, displayNsdMessages );
for( int i = 0; i < sclFiles.size(); ++i ) {
run( makeExplicitLinks, sclFiles.get( i ));
}
......@@ -165,7 +169,7 @@ public class RiseClipseValidatorSCL {
console.info( "" );
}
private static void prepare( ArrayList< @NonNull String > oclFiles, ArrayList< @NonNull String > nsdFiles ) {
private static void prepare( ArrayList< @NonNull String > oclFiles, ArrayList< @NonNull String > nsdFiles, boolean displayNsdMessages ) {
SclPackage sclPg = SclPackage.eINSTANCE;
if( sclPg == null ) {
throw new RiseClipseFatalException( "SCL package not found", null );
......@@ -187,7 +191,7 @@ public class RiseClipseValidatorSCL {
for( int i = 0; i < nsdFiles.size(); ++i ) {
nsdValidator.addNsdDocument( nsdFiles.get( i ), console );
}
nsdValidator.prepare( validator, console );
nsdValidator.prepare( validator, console, displayNsdMessages );
}
sclLoader = new SclModelLoader( console );
......
......@@ -38,11 +38,18 @@ public class NsdValidator {
nsdLoader.load( nsdFile );
}
public void prepare( @NonNull ComposedEValidator validator, IRiseClipseConsole console ) {
public void prepare( @NonNull ComposedEValidator validator, IRiseClipseConsole console, boolean displayNsdMessages ) {
int level = 0;
if( ! displayNsdMessages ) {
level = console.setLevel( IRiseClipseConsole.ERROR_LEVEL );
}
nsdLoader.getResourceSet().finalizeLoad( console );
NsdEObjectValidator nsdEObjectValidator = new NsdEObjectValidator( nsdLoader.getResourceSet() );
nsdEObjectValidator.initializeValidationData();
validator.addChild( nsdEObjectValidator );
if( ! displayNsdMessages ) {
console.setLevel( level );
}
}
}
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