Skip to content

Package: AstCompositeExpression

AstCompositeExpression

nameinstructionbranchcomplexitylinemethod
AstCompositeExpression(int)
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%
getType(EvaluationContext)
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%
getValue(EvaluationContext)
M: 35 C: 0
0%
M: 6 C: 0
0%
M: 4 C: 0
0%
M: 8 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*
2: * Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.
3: * Copyright (c) 2021 Payara Services Ltd.
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.parser;
19:
20: import jakarta.el.ELException;
21:
22: import com.sun.el.lang.EvaluationContext;
23:
24: /**
25: * @author Jacob Hookom [jacob@hookom.net]
26: * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: kchung $
27: */
28: public final class AstCompositeExpression extends SimpleNode {
29:
30: public AstCompositeExpression(int id) {
31: super(id);
32: }
33:
34: @Override
35: public Class getType(EvaluationContext ctx) throws ELException {
36: return String.class;
37: }
38:
39: @Override
40: public Object getValue(EvaluationContext ctx) throws ELException {
41: StringBuilder sb = new StringBuilder(16);
42: Object obj = null;
43:• if (this.children != null) {
44:• for (int i = 0; i < this.children.length; i++) {
45: obj = this.children[i].getValue(ctx);
46:• if (obj != null) {
47: sb.append(obj);
48: }
49: }
50: }
51: return sb.toString();
52: }
53: }