Link to known property name constants in SpringProperties

This commit is contained in:
Sam Brannen
2021-02-02 15:20:41 +01:00
parent c649b74235
commit 8589804012
2 changed files with 17 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -30,10 +30,17 @@ import org.springframework.lang.Nullable;
*/
public class SpelParserConfiguration {
/**
* System property that is used to configure the default compiler mode for
* SpEL expression parsers: {@value}
*/
public static final String SPRING_EXPRESSION_COMPILER_MODE_PROPERTY_NAME = "spring.expression.compiler.mode";
private static final SpelCompilerMode defaultCompilerMode;
static {
String compilerMode = SpringProperties.getProperty("spring.expression.compiler.mode");
String compilerMode = SpringProperties.getProperty(SPRING_EXPRESSION_COMPILER_MODE_PROPERTY_NAME);
defaultCompilerMode = (compilerMode != null ?
SpelCompilerMode.valueOf(compilerMode.toUpperCase()) : SpelCompilerMode.OFF);
}
@@ -107,7 +114,7 @@ public class SpelParserConfiguration {
/**
* Return the configuration mode for parsers using this configuration object.
* Return the compiler mode for parsers using this configuration object.
*/
public SpelCompilerMode getCompilerMode() {
return this.compilerMode;