1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17 package org.apache.commons.scxml2.model;
18
19 import java.io.Serializable;
20 import java.util.Map;
21
22 /**
23 * The class in this SCXML object model that corresponds to the
24 * <param> SCXML element.
25 *
26 */
27 public class Param implements NamespacePrefixesHolder, Serializable {
28
29 /**
30 * Serial version UID.
31 */
32 private static final long serialVersionUID = 1L;
33
34 /**
35 * The param name.
36 */
37 private String name;
38
39 /**
40 * Left hand side expression evaluating to a location within
41 * a previously defined XML data tree.
42 */
43 private String location;
44
45 /**
46 * The param expression, may be null.
47 */
48 private String expr;
49
50 /**
51 * The current XML namespaces in the SCXML document for this action node,
52 * preserved for deferred XPath evaluation.
53 */
54 private Map<String, String> namespaces;
55
56 /**
57 * Default no-args constructor
58 */
59 public Param() {
60 name = null;
61 expr = null;
62 }
63 /**
64 * Get the name for this param.
65 *
66 * @return String The param name.
67 */
68 public final String getName() {
69 return name;
70 }
71
72 /**
73 * Set the name for this param.
74 *
75 * @param name The param name.
76 */
77 public final void setName(final String name) {
78 this.name = name;
79 }
80
81 /**
82 * Get the location for a previously defined XML data tree.
83 *
84 * @return Returns the location.
85 */
86 public String getLocation() {
87 return location;
88 }
89
90 /**
91 * Set the location for a previously defined XML data tree.
92 *
93 * @param location The location.
94 */
95 public void setLocation(final String location) {
96 this.location = location;
97 }
98
99 /**
100 * Get the expression for this param value.
101 *
102 * @return String The expression for this param value.
103 */
104 public final String getExpr() {
105 return expr;
106 }
107
108 /**
109 * Set the expression for this param value.
110 *
111 * @param expr The expression for this param value.
112 */
113 public final void setExpr(final String expr) {
114 this.expr = expr;
115 }
116
117 /**
118 * Get the XML namespaces at this action node in the SCXML document.
119 *
120 * @return Returns the map of namespaces.
121 */
122 public final Map<String, String> getNamespaces() {
123 return namespaces;
124 }
125
126 /**
127 * Set the XML namespaces at this action node in the SCXML document.
128 *
129 * @param namespaces The document namespaces.
130 */
131 public final void setNamespaces(final Map<String, String> namespaces) {
132 this.namespaces = namespaces;
133 }
134
135 }
136