| Classes in this File | Line Coverage | Branch Coverage | Complexity | |||||||
| Data |
|
| 1.0;1 |
| 1 | /* |
|
| 2 | * |
|
| 3 | * Copyright 2006 The Apache Software Foundation. |
|
| 4 | * |
|
| 5 | * Licensed under the Apache License, Version 2.0 (the "License"); |
|
| 6 | * you may not use this file except in compliance with the License. |
|
| 7 | * 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 | */ |
|
| 18 | package org.apache.commons.scxml.model; |
|
| 19 | ||
| 20 | import org.w3c.dom.Node; |
|
| 21 | ||
| 22 | /** |
|
| 23 | * The class in this SCXML object model that corresponds to the SCXML |
|
| 24 | * <data> child element of the <datamodel> element. |
|
| 25 | * |
|
| 26 | */ |
|
| 27 | public class Data { |
|
| 28 | ||
| 29 | /** |
|
| 30 | * The name of this data instance, that is used as its identifier. |
|
| 31 | */ |
|
| 32 | private String name; |
|
| 33 | ||
| 34 | /** |
|
| 35 | * The URL to get the XML data tree from. |
|
| 36 | */ |
|
| 37 | private String src; |
|
| 38 | ||
| 39 | /** |
|
| 40 | * The expression that evaluates to the value of this data instance. |
|
| 41 | */ |
|
| 42 | private String expr; |
|
| 43 | ||
| 44 | /** |
|
| 45 | * The child XML data tree, parsed as a Node, cloned per execution |
|
| 46 | * instance. |
|
| 47 | */ |
|
| 48 | private Node node; |
|
| 49 | ||
| 50 | /** |
|
| 51 | * Constructor. |
|
| 52 | */ |
|
| 53 | 14 | public Data() { |
| 54 | 14 | this.name = null; |
| 55 | 14 | this.src = null; |
| 56 | 14 | this.expr = null; |
| 57 | 14 | this.node = null; |
| 58 | 14 | } |
| 59 | ||
| 60 | /** |
|
| 61 | * Get the name. |
|
| 62 | * |
|
| 63 | * @return String The name. |
|
| 64 | */ |
|
| 65 | public final String getName() { |
|
| 66 | 14 | return name; |
| 67 | } |
|
| 68 | ||
| 69 | /** |
|
| 70 | * Set the name. |
|
| 71 | * |
|
| 72 | * @param name The name. |
|
| 73 | */ |
|
| 74 | public final void setName(final String name) { |
|
| 75 | 14 | this.name = name; |
| 76 | 14 | } |
| 77 | ||
| 78 | /** |
|
| 79 | * Get the URL where the XML data tree resides. |
|
| 80 | * |
|
| 81 | * @return String The URL. |
|
| 82 | */ |
|
| 83 | public final String getSrc() { |
|
| 84 | 14 | return src; |
| 85 | } |
|
| 86 | ||
| 87 | /** |
|
| 88 | * Set the URL where the XML data tree resides. |
|
| 89 | * |
|
| 90 | * @param src The source URL. |
|
| 91 | */ |
|
| 92 | public final void setSrc(final String src) { |
|
| 93 | 0 | this.src = src; |
| 94 | 0 | } |
| 95 | ||
| 96 | /** |
|
| 97 | * Get the expression that evaluates to the value of this data instance. |
|
| 98 | * |
|
| 99 | * @return String The expression. |
|
| 100 | */ |
|
| 101 | public final String getExpr() { |
|
| 102 | 18 | return expr; |
| 103 | } |
|
| 104 | ||
| 105 | /** |
|
| 106 | * Set the expression that evaluates to the value of this data instance. |
|
| 107 | * |
|
| 108 | * @param expr The expression. |
|
| 109 | */ |
|
| 110 | public final void setExpr(final String expr) { |
|
| 111 | 4 | this.expr = expr; |
| 112 | 4 | } |
| 113 | ||
| 114 | /** |
|
| 115 | * Get the XML data tree. |
|
| 116 | * |
|
| 117 | * @return Node The XML data tree, parsed as a <code>Node</code>. |
|
| 118 | */ |
|
| 119 | public final Node getNode() { |
|
| 120 | 14 | return node; |
| 121 | } |
|
| 122 | ||
| 123 | /** |
|
| 124 | * Set the XML data tree. |
|
| 125 | * |
|
| 126 | * @param node The XML data tree, parsed as a <code>Node</code>. |
|
| 127 | */ |
|
| 128 | public final void setNode(final Node node) { |
|
| 129 | 10 | this.node = node; |
| 130 | 10 | } |
| 131 | ||
| 132 | } |
|
| 133 |