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     */
017    package org.apache.commons.scxml.model;
018    
019    import java.io.Serializable;
020    import java.util.ArrayList;
021    import java.util.List;
022    
023    /**
024     * The class in this SCXML object model that corresponds to the SCXML
025     * <datamodel> element.
026     *
027     */
028    public class Datamodel implements Serializable {
029    
030       /**
031        * Serial version UID.
032        */
033       private static final long serialVersionUID = 1L;
034    
035       /**
036        * The set of <data> elements, parsed as Elements, that are
037        * children of this <datamodel> element.
038        */
039       private List data;
040    
041       /**
042        * Constructor.
043        */
044       public Datamodel() {
045           this.data = new ArrayList();
046       }
047    
048       /**
049        * Get all the data children of this datamodel.
050        *
051        * @return Returns the data.
052        */
053       public final List getData() {
054           return data;
055       }
056    
057       /**
058        * Add a Data.
059        *
060        * @param datum The data child to be added.
061        */
062       public final void addData(final Data datum) {
063           if (datum != null) {
064               data.add(datum);
065           }
066       }
067    
068    }
069