Skip to content

Package: TagVariableInfo

TagVariableInfo

nameinstructionbranchcomplexitylinemethod
TagVariableInfo(String, String, String, boolean, int)
M: 18 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 7 C: 0
0%
M: 1 C: 0
0%
getClassName()
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%
getDeclare()
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%
getNameFromAttribute()
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%
getNameGiven()
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%
getScope()
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%

Coverage

1: /*
2: * Copyright (c) 1997, 2020 Oracle and/or its affiliates and others.
3: * All rights reserved.
4: * Copyright 2004 The Apache Software Foundation
5: *
6: * Licensed under the Apache License, Version 2.0 (the "License");
7: * you may not use this file except in compliance with the License.
8: * You may obtain a copy of the License at
9: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS,
14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15: * See the License for the specific language governing permissions and
16: * limitations under the License.
17: */
18:
19: package jakarta.servlet.jsp.tagext;
20:
21: /**
22: * Variable information for a tag in a Tag Library; This class is instantiated from the Tag Library Descriptor file
23: * (TLD) and is available only at translation time.
24: *
25: * This object should be immutable.
26: *
27: * This information is only available in JSP 1.2 format TLDs or above.
28: */
29: public class TagVariableInfo {
30:
31: /**
32: * Constructor for TagVariableInfo.
33: *
34: * @param nameGiven value of <name-given>
35: * @param nameFromAttribute value of <name-from-attribute>
36: * @param className value of <variable-class>
37: * @param declare value of <declare>
38: * @param scope value of <scope>
39: */
40: public TagVariableInfo(String nameGiven, String nameFromAttribute, String className, boolean declare, int scope) {
41: this.nameGiven = nameGiven;
42: this.nameFromAttribute = nameFromAttribute;
43: this.className = className;
44: this.declare = declare;
45: this.scope = scope;
46: }
47:
48: /**
49: * The body of the <name-given> element.
50: *
51: * @return The variable name as a constant
52: */
53: public String getNameGiven() {
54: return nameGiven;
55: }
56:
57: /**
58: * The body of the <name-from-attribute> element. This is the name of an attribute whose (translation-time)
59: * value will give the name of the variable. One of <name-given> or <name-from-attribute> is required.
60: *
61: * @return The attribute whose value defines the variable name
62: */
63: public String getNameFromAttribute() {
64: return nameFromAttribute;
65: }
66:
67: /**
68: * The body of the <variable-class> element.
69: *
70: * @return The name of the class of the variable or 'java.lang.String' if not defined in the TLD.
71: */
72: public String getClassName() {
73: return className;
74: }
75:
76: /**
77: * The body of the <declare> element.
78: *
79: * @return Whether the variable is to be declared or not. If not defined in the TLD, 'true' will be returned.
80: */
81: public boolean getDeclare() {
82: return declare;
83: }
84:
85: /**
86: * The body of the <scope> element.
87: *
88: * @return The scope to give the variable. NESTED scope will be returned if not defined in the TLD.
89: */
90: public int getScope() {
91: return scope;
92: }
93:
94: /*
95: * private fields
96: */
97: private String nameGiven; // <name-given>
98: private String nameFromAttribute; // <name-from-attribute>
99: private String className; // <class>
100: private boolean declare; // <declare>
101: private int scope; // <scope>
102: }