KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > scriptella > configuration > ScriptEl


1 /*
2  * Copyright 2006-2007 The Scriptella Project Team.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package scriptella.configuration;
17
18 import java.util.List JavaDoc;
19
20 /**
21  * TODO: Add documentation
22  *
23  * @author Fyodor Kupolov
24  * @version 1.0
25  */

26 public class ScriptEl extends ScriptingElement {
27     public static final String JavaDoc TAG_NAME = "script";
28     private boolean newTx;
29     protected List JavaDoc<OnErrorEl> onerrors;
30
31     public ScriptEl(XmlElement element, ScriptingElement parent) {
32         super(parent);
33         configure(element);
34     }
35
36     public boolean isNewTx() {
37         return newTx;
38     }
39
40     public void setNewTx(final boolean newTx) {
41         this.newTx = newTx;
42     }
43
44     public List JavaDoc<OnErrorEl> getOnerrorElements() {
45         return onerrors;
46     }
47
48     public void setOnerrorElements(List JavaDoc<OnErrorEl> list) {
49         onerrors = list;
50     }
51
52     public void configure(final XmlElement element) {
53         super.configure(element);
54         newTx = element.getBooleanAttribute("new-tx", false);
55         //The following code loads nested onerror elements
56
onerrors = load(element.getChildren("onerror"), OnErrorEl.class);
57     }
58
59     public String JavaDoc toString() {
60         return "ScriptEl{" + super.toString() + ", newTx=" + newTx + "}";
61     }
62 }
63
Popular Tags