01: /******************************************************************************
02: * Copyright (C) Lars Ivar Almli. All rights reserved. *
03: * ---------------------------------------------------------------------------*
04: * This file is part of MActor. *
05: * *
06: * MActor is free software; you can redistribute it and/or modify *
07: * it under the terms of the GNU General Public License as published by *
08: * the Free Software Foundation; either version 2 of the License, or *
09: * (at your option) any later version. *
10: * *
11: * MActor is distributed in the hope that it will be useful, *
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14: * GNU General Public License for more details. *
15: * *
16: * You should have received a copy of the GNU General Public License *
17: * along with MActor; if not, write to the Free Software *
18: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA *
19: ******************************************************************************/package org.mactor.framework.spec;
20:
21: import org.dom4j.Element;
22: import org.mactor.framework.MactorException;
23: import org.mactor.framework.ParseUtil;
24:
25: public class LoopSpec extends ContainerSpec {
26: private int count;
27:
28: public int getCount() {
29: return count;
30: }
31:
32: public static LoopSpec loadSpec(Element element)
33: throws MactorException {
34: if (element == null)
35: return null;
36: LoopSpec s = new LoopSpec();
37: s.name = element.attributeValue("name");
38: String val = element.attributeValue("count");
39: if (val != null)
40: s.count = ParseUtil.tryParseIntVal(val);
41: s.loadContainedNodes(element);
42: return s;
43: }
44:
45: public String getShortDescription() {
46: return "Loop node - '" + name + "'";
47: }
48:
49: public String getDescription() {
50: return "Loop count:" + count;
51: }
52: }
|