View Javadoc

1   /*
2    * EDI-Knight Integration and Transformation Platform
3    * Copyright (C) 2006-2007 Holger Joest <hjoest@users.sourceforge.net>
4    *
5    * This program is free software; you can redistribute it and/or modify
6    * it under the terms of the GNU General Public License as published by
7    * the Free Software Foundation; either version 2 of the License, or
8    * (at your option) any later version.
9    *
10   * This program is distributed in the hope that it will be useful,
11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13   * GNU General Public License for more details.
14   *
15   * You should have received a copy of the GNU General Public License
16   * along with this program; if not, write to the Free Software
17   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18   */
19  
20  package net.sf.ediknight.common.edi.directory;
21  
22  import java.util.ArrayList;
23  import java.util.List;
24  
25  import net.sf.ediknight.edi.directory.CompositeElement;
26  import net.sf.ediknight.edi.directory.SimpleElementNode;
27  
28  
29  /***
30   * @author Holger Joest
31   */
32  public final class CompositeElementImpl
33  extends ElementImpl
34  implements CompositeElement {
35  
36      private static final long serialVersionUID =
37          -1289913600311335561L;
38  
39      private List<SimpleElementNode> elementNodes =
40          new ArrayList<SimpleElementNode>();
41  
42  
43      /***
44       * Constructor.
45       */
46      public CompositeElementImpl() {
47      }
48  
49  
50      /***
51       * Add an element to this composite.
52       *
53       * @param elementNode the element node
54       */
55      public void addElement(SimpleElementNode elementNode) {
56          elementNodes.add(elementNode);
57      }
58  
59  
60      /***
61       * {@inheritDoc}
62       * @see net.sf.ediknight.edi.directory.CompositeElement
63       *      #getElementNodes()
64       */
65      public List<SimpleElementNode> getElementNodes() {
66          return elementNodes;
67      }
68  
69  
70      /***
71       * {@inheritDoc}
72       * @see java.lang.Object#toString()
73       */
74      @Override
75      public String toString() {
76          return "composite element ("
77          + getId() + ", " + getName() + ")";
78      }
79  
80  }
81