1 /*
2 * Copyright 2008 FatWire Corporation. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 package tools.gsf.facade.runtag.vdm;
18
19 import tools.gsf.facade.runtag.AbstractTagRunner;
20
21 /**
22 * Wrapper around the VDM.GETSCALAR xml tag
23 *
24 * @author Tony Field and Mike Field
25 * @since June 9, 2008
26 */
27 public final class GetScalar extends AbstractTagRunner {
28 public GetScalar(String attribute, String varname) {
29 this();
30 setAttribute(attribute);
31 setVarname(varname);
32 }
33
34 // Default Constructor
35 public GetScalar() {
36 super("VDM.GETSCALAR");
37 }
38
39 /**
40 * Sets attribute to the value of <code>s</code>
41 *
42 * @param s The name of the attribute
43 */
44 public void setAttribute(String s) {
45 // validate first
46 if (s == null || s.length() == 0) {
47 throw new IllegalArgumentException("Invalid attribute string: " + s);
48 }
49 this.set("ATTRIBUTE", s);
50 }
51
52 /**
53 * Sets the varname to the value of <code>s</code>
54 *
55 * @param s The name of the varname
56 */
57 public void setVarname(String s) {
58 // validate first
59 if (s == null || s.length() == 0) {
60 throw new IllegalArgumentException("Invalid varname string: " + s);
61 }
62 this.set("VARNAME", s);
63 }
64
65 }