Skip to content

Package: EvaluationContext

EvaluationContext

nameinstructionbranchcomplexitylinemethod
EvaluationContext(ELContext, FunctionMapper, VariableMapper)
M: 12 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
addEvaluationListener(EvaluationListener)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
convertToType(Object, Class)
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
enterLambdaScope(Map)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
exitLambdaScope()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
getContext(Class)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getELContext()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getELResolver()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getEvaluationListeners()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getFunctionMapper()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getImportHandler()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getLambdaArgument(String)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getVariableMapper()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
isLambdaArgument(String)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
isPropertyResolved()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
notifyAfterEvaluation(String)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
notifyBeforeEvaluation(String)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
notifyPropertyResolved(Object, Object)
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
putContext(Class, Object)
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
setPropertyResolved(Object, Object)
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
setPropertyResolved(boolean)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*
2: * Copyright (c) 1997, 2021 Oracle and/or its affiliates and others.
3: * All rights reserved.
4: *
5: * This program and the accompanying materials are made available under the
6: * terms of the Eclipse Public License v. 2.0, which is available at
7: * http://www.eclipse.org/legal/epl-2.0.
8: *
9: * This Source Code may also be made available under the following Secondary
10: * Licenses when the conditions for such availability set forth in the
11: * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
12: * version 2 with the GNU Classpath Exception, which is available at
13: * https://www.gnu.org/software/classpath/license.html.
14: *
15: * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16: */
17:
18: package com.sun.el.lang;
19:
20: import java.util.List;
21: import java.util.Map;
22:
23: import jakarta.el.ELContext;
24: import jakarta.el.ELResolver;
25: import jakarta.el.EvaluationListener;
26: import jakarta.el.FunctionMapper;
27: import jakarta.el.ImportHandler;
28: import jakarta.el.VariableMapper;
29:
30: /**
31: * The context for Jakarta Expression expression evaluation. This wrapper ELContext captures the function mapper and the
32: * variable mapper at the point when the expression is parsed, and only for those functions and variable used in the
33: * expression.
34: */
35: public final class EvaluationContext extends ELContext {
36:
37: private final ELContext elContext;
38: private final FunctionMapper fnMapper;
39: private final VariableMapper varMapper;
40:
41: public EvaluationContext(ELContext elContext, FunctionMapper fnMapper, VariableMapper varMapper) {
42: this.elContext = elContext;
43: this.fnMapper = fnMapper;
44: this.varMapper = varMapper;
45: }
46:
47: public ELContext getELContext() {
48: return elContext;
49: }
50:
51: @Override
52: public FunctionMapper getFunctionMapper() {
53: return fnMapper;
54: }
55:
56: @Override
57: public VariableMapper getVariableMapper() {
58: return varMapper;
59: }
60:
61: @Override
62: public Object getContext(Class key) {
63: return elContext.getContext(key);
64: }
65:
66: @Override
67: public ELResolver getELResolver() {
68: return elContext.getELResolver();
69: }
70:
71: @Override
72: public boolean isPropertyResolved() {
73: return elContext.isPropertyResolved();
74: }
75:
76: @Override
77: public void putContext(Class key, Object contextObject) {
78: elContext.putContext(key, contextObject);
79: }
80:
81: @Override
82: public void setPropertyResolved(boolean resolved) {
83: elContext.setPropertyResolved(resolved);
84: }
85:
86: @Override
87: public void setPropertyResolved(Object base, Object property) {
88: elContext.setPropertyResolved(base, property);
89: }
90:
91: @Override
92: public void addEvaluationListener(EvaluationListener listener) {
93: elContext.addEvaluationListener(listener);
94: }
95:
96: @Override
97: public List<EvaluationListener> getEvaluationListeners() {
98: return elContext.getEvaluationListeners();
99: }
100:
101: @Override
102: public void notifyBeforeEvaluation(String expr) {
103: elContext.notifyBeforeEvaluation(expr);
104: }
105:
106: @Override
107: public void notifyAfterEvaluation(String expr) {
108: elContext.notifyAfterEvaluation(expr);
109: }
110:
111: @Override
112: public void notifyPropertyResolved(Object base, Object property) {
113: elContext.notifyPropertyResolved(base, property);
114: }
115:
116: @Override
117: public boolean isLambdaArgument(String arg) {
118: return elContext.isLambdaArgument(arg);
119: }
120:
121: @Override
122: public Object getLambdaArgument(String arg) {
123: return elContext.getLambdaArgument(arg);
124: }
125:
126: @Override
127: public void enterLambdaScope(Map<String, Object> args) {
128: elContext.enterLambdaScope(args);
129: }
130:
131: @Override
132: public void exitLambdaScope() {
133: elContext.exitLambdaScope();
134: }
135:
136: @Override
137: public <T> T convertToType(Object obj, Class<T> targetType) {
138: return elContext.convertToType(obj, targetType);
139: }
140:
141: @Override
142: public ImportHandler getImportHandler() {
143: return elContext.getImportHandler();
144: }
145: }