Skip to content

Package: NotFoundELResolver

NotFoundELResolver

nameinstructionbranchcomplexitylinemethod
NotFoundELResolver()
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%
getCommonPropertyType(ELContext, Object)
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getFeatureDescriptors(ELContext, Object)
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getType(ELContext, Object, Object)
M: 8 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
getValue(ELContext, Object, Object)
M: 11 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%
isReadOnly(ELContext, Object, Object)
M: 8 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
setValue(ELContext, Object, Object, Object)
M: 7 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*
2: * Copyright (c) 2021 Contributors to the Eclipse Foundation.
3: *
4: * This program and the accompanying materials are made available under the
5: * terms of the Eclipse Public License v. 2.0, which is available at
6: * http://www.eclipse.org/legal/epl-2.0.
7: *
8: * This Source Code may also be made available under the following Secondary
9: * Licenses when the conditions for such availability set forth in the
10: * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11: * version 2 with the GNU Classpath Exception, which is available at
12: * https://www.gnu.org/software/classpath/license.html.
13: *
14: * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15: */
16: package jakarta.servlet.jsp.el;
17:
18: import java.beans.FeatureDescriptor;
19: import java.util.Iterator;
20: import java.util.Collections;
21:
22: import jakarta.el.ELContext;
23: import jakarta.el.ELResolver;
24: import jakarta.el.ELException;
25:
26: /**
27: * Defines variable resolution when all other resolvers fail.
28: *
29: * @since JSP 3.1
30: */
31: public class NotFoundELResolver extends ELResolver {
32:
33: /**
34: * If the base object is <code>null</code>, searches the Class and static imports for an import with the given name
35: * and returns it if an import exists with the given name.
36: *
37: * <p>
38: * The <code>propertyResolved</code> property of the <code>ELContext</code> object is always set to {@code true}
39: * by this resolver before returning.
40: * </p>
41: *
42: * @param context The context of this evaluation.
43: * @param base Ignored
44: * @param property Ignored
45: * @return Always {@code null}
46: * @throws NullPointerException if context is <code>null</code>
47: * @throws ELException if an exception was thrown while performing the property or variable resolution. The
48: * thrown exception must be included as the cause property of this exception, if
49: * available.
50: */
51: @Override
52: public Object getValue(ELContext context, Object base, Object property) {
53:
54:• if (context == null) {
55: throw new NullPointerException();
56: }
57:
58: context.setPropertyResolved(true);
59:
60: return null;
61: }
62:
63: /**
64: * Always returns {@code null} since in normal usage {@link ScopedAttributeELResolver} will handle calls to
65: * {@link ELResolver#getType(ELContext, Object, Object)}.
66: *
67: * @param context The context of this evaluation.
68: * @param base Ignored
69: * @param property Ignored
70: * @return Always {@code null}
71: * @throws NullPointerException if context is <code>null</code>
72: * @throws ELException if an exception was thrown while performing the property or variable resolution. The
73: * thrown exception must be included as the cause property of this exception, if
74: * available.
75: */
76: @Override
77: public Class<Object> getType(ELContext context, Object base, Object property) {
78:
79:• if (context == null) {
80: throw new NullPointerException();
81: }
82:
83: return null;
84: }
85:
86: /**
87: * Always a NO-OP since in normal usage {@link ScopedAttributeELResolver} will handle calls to
88: * {@link ELResolver#setValue(ELContext, Object, Object, Object)}.
89: *
90: * @param context The context of this evaluation.
91: * @param base Ignored
92: * @param property Ignored
93: * @param val Ignored
94: * @throws NullPointerException if context is <code>null</code>.
95: * @throws ELException if an exception was thrown while performing the property or variable resolution. The
96: * thrown exception must be included as the cause property of this exception, if
97: * available.
98: */
99: @Override
100: public void setValue(ELContext context, Object base, Object property, Object val) {
101:• if (context == null) {
102: throw new NullPointerException();
103: }
104: }
105:
106: /**
107: * Always returns {@code false} since in normal usage {@link ScopedAttributeELResolver} will handle calls to
108: * {@link ELResolver#isReadOnly(ELContext, Object, Object)}.
109: *
110: * @param context The context of this evaluation.
111: * @param base Ignored
112: * @param property Ignored
113: * @return Always {@code false}
114: * @throws NullPointerException if context is <code>null</code>.
115: * @throws ELException if an exception was thrown while performing the property or variable resolution. The
116: * thrown exception must be included as the cause property of this exception, if
117: * available.
118: */
119: @Override
120: public boolean isReadOnly(ELContext context, Object base, Object property) {
121:• if (context == null) {
122: throw new NullPointerException();
123: }
124: return false;
125: }
126:
127: /**
128: * Always returns an empty iterator since {@link ELResolver#getFeatureDescriptors} method has been deprecated.
129: *
130: * @param context Ignored
131: * @param base Ignored
132: * @return An <code>Iterator</code> containing one <code>FeatureDescriptor</code> object for each scoped attribute,
133: * or <code>null</code> if <code>base</code> is not <code>null</code>.
134: *
135: * @deprecated This method is deprecated as of EL 5.0 and will be removed in EL 6.0 (Jakarta EE 11). Therefore it
136: * will be removed here in JSP 4.0.
137: */
138: @Deprecated(forRemoval = true, since = "JSP 3.1")
139: @Override
140: public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base) {
141: return Collections.emptyIterator();
142: }
143:
144: /**
145: * Always returns {@code null} since in normal usage {@link ScopedAttributeELResolver} will handle calls to
146: * {@link ELResolver#getCommonPropertyType(ELContext, Object)}.
147: *
148: * @param context Ignored
149: * @param base Ignored
150: *
151: * @return Always {@code null}
152: */
153: @Override
154: public Class<String> getCommonPropertyType(ELContext context, Object base) {
155: return null;
156: }
157: }