KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > shark > xpdl > elements > ExtendedAttribute


1 package org.enhydra.shark.xpdl.elements;
2
3 import org.enhydra.shark.xpdl.XMLAttribute;
4 import org.enhydra.shark.xpdl.XMLComplexElement;
5
6 /**
7  * Represents coresponding element from XPDL schema.
8  *
9  * @author Sasa Bojanic
10  */

11 public class ExtendedAttribute extends XMLComplexElement {
12
13    public ExtendedAttribute (ExtendedAttributes parent) {
14       super(parent, true);
15    }
16
17    protected void fillStructure () {
18       XMLAttribute attrName=new XMLAttribute(this,"Name", true); // required
19
XMLAttribute attrValue=new XMLAttribute(this,"Value", false);
20
21       add(attrName);
22       add(attrValue);
23    }
24
25    public void setValue(String JavaDoc v) {
26       if (isReadOnly) {
27          throw new RuntimeException JavaDoc("Can't set the value of read only element!");
28       }
29       this.value = v;
30    }
31    
32    public String JavaDoc getName() {
33       return get("Name").toValue();
34    }
35    public void setName(String JavaDoc name) {
36       set("Name",name);
37    }
38    public String JavaDoc getVValue() {
39       return get("Value").toValue();
40    }
41    public void setVValue(String JavaDoc value) {
42       set("Value",value);
43    }
44
45 }
46
Popular Tags