001/* 002 * Copyright 2002-2014 the original author or authors. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * https://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 017package org.springframework.expression.spel; 018 019/** 020 * Captures the possible configuration settings for a compiler that can be 021 * used when evaluating expressions. 022 * 023 * @author Andy Clement 024 * @since 4.1 025 */ 026public enum SpelCompilerMode { 027 028 /** 029 * The compiler is switched off; this is the default. 030 */ 031 OFF, 032 033 /** 034 * In immediate mode, expressions are compiled as soon as possible (usually after 1 interpreted run). 035 * If a compiled expression fails it will throw an exception to the caller. 036 */ 037 IMMEDIATE, 038 039 /** 040 * In mixed mode, expression evaluation silently switches between interpreted and compiled over time. 041 * After a number of runs the expression gets compiled. If it later fails (possibly due to inferred 042 * type information changing) then that will be caught internally and the system switches back to 043 * interpreted mode. It may subsequently compile it again later. 044 */ 045 MIXED 046 047}