001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *     http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.commons.scxml2.model;
018
019import java.io.Serializable;
020import java.util.Map;
021
022/**
023 * The class in this SCXML object model that corresponds to the
024 * <param> SCXML element.
025 *
026 */
027public class Param implements NamespacePrefixesHolder, Serializable {
028
029    /**
030     * Serial version UID.
031     */
032    private static final long serialVersionUID = 1L;
033
034    /**
035     * The param name.
036     */
037    private String name;
038
039    /**
040     * Left hand side expression evaluating to a location within
041     * a previously defined XML data tree.
042     */
043    private String location;
044
045    /**
046     * The param expression, may be null.
047     */
048    private String expr;
049
050    /**
051     * The current XML namespaces in the SCXML document for this action node,
052     * preserved for deferred XPath evaluation.
053     */
054    private Map<String, String> namespaces;
055
056    /**
057     * Default no-args constructor
058     */
059    public Param() {
060        name = null;
061        expr = null;
062    }
063    /**
064     * Get the name for this param.
065     *
066     * @return String The param name.
067     */
068    public final String getName() {
069        return name;
070    }
071
072    /**
073     * Set the name for this param.
074     *
075     * @param name The param name.
076     */
077    public final void setName(final String name) {
078        this.name = name;
079    }
080
081    /**
082     * Get the location for a previously defined XML data tree.
083     *
084     * @return Returns the location.
085     */
086    public String getLocation() {
087        return location;
088    }
089
090    /**
091     * Set the location for a previously defined XML data tree.
092     *
093     * @param location The location.
094     */
095    public void setLocation(final String location) {
096        this.location = location;
097    }
098
099    /**
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