private int determineLangLevel() { final String prop = this.conf.getChainedProperties().getProperty( "drools.dialect.mvel.langLevel", "4" ); return Integer.valueOf( prop ).intValue(); }
private boolean determineStrict() { final String prop = this.conf.getChainedProperties().getProperty( "drools.dialect.mvel.strict", "true" ); return Boolean.valueOf( prop ).booleanValue(); }
/** * This will attempt to read the System property to work out what default to set. * This should only be done once when the class is loaded. After that point, you will have * to programmatically override it. */ private int getDefaultCompiler() { try { final String prop = this.conf.getChainedProperties().getProperty( JAVA_COMPILER_PROPERTY, "ECLIPSE" ); if ( prop.equals( "ECLIPSE".intern() ) ) { return ECLIPSE; } else if ( prop.equals( "JANINO" ) ) { return JANINO; } else { logger.error( "Drools config: unable to use the drools.compiler property. Using default. It was set to:" + prop ); return ECLIPSE; } } catch ( final SecurityException e ) { logger.error( "Drools config: unable to read the drools.compiler property. Using default.", e); return ECLIPSE; } }
private String getDefaultLanguageLevel() { String level = this.conf.getChainedProperties().getProperty( "drools.dialect.java.compiler.lnglevel", null ); if ( level == null ) { String version = System.getProperty( "java.version" ); if ( version.startsWith( "1.5" ) ) { level = "1.5"; } else if ( version.startsWith( "1.6" ) ) { level = "1.6"; } else if ( version.startsWith( "1.7" ) ) { level = "1.7"; } else { level = "1.5"; } } if ( Arrays.binarySearch( LANGUAGE_LEVELS, level ) < 0 ) { throw new RuntimeDroolsException( "value '" + level + "' is not a valid language level" ); } return level; }