Changeset 35
- Timestamp:
- 08/02/05 22:48:09 (3 years ago)
- Files:
-
- trunk/src/net/schst/XJConf/AttributeDefinition.java (modified) (3 diffs)
- trunk/src/net/schst/XJConf/ChildDefinition.java (modified) (2 diffs)
- trunk/src/net/schst/XJConf/DefinitionParser.java (modified) (2 diffs)
- trunk/src/net/schst/XJConf/TagDefinition.java (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/net/schst/XJConf/AttributeDefinition.java
r32 r35 3 3 import net.schst.XJConf.exceptions.MissingAttributeException; 4 4 import net.schst.XJConf.exceptions.ValueConversionException; 5 import net.schst.XJConf.exceptions.XJConfException; 5 6 6 7 /** … … 55 56 * @param name of the attribute 56 57 */ 57 public AttributeDefinition(String name) { 58 public AttributeDefinition(String name) 59 throws XJConfException { 60 61 if (name == null) { 62 throw new XJConfException("TagDefinition needs a name."); 63 } 58 64 this.name = name; 59 65 this.type = "java.lang.String"; 66 this.vConverter = new ObjectValueConverter(this.type); 60 67 } 61 68 … … 66 73 * @param type of the attribute 67 74 */ 68 public AttributeDefinition(String name, String type) { 75 public AttributeDefinition(String name, String type) 76 throws XJConfException { 77 if (name == null) { 78 throw new XJConfException("AttributeDefinition needs a name."); 79 } 80 if (type == null) { 81 throw new XJConfException("AttributeDefinition needs a type."); 82 } 83 69 84 this.name = name; 70 85 this.type = type; trunk/src/net/schst/XJConf/ChildDefinition.java
r32 r35 2 2 3 3 import net.schst.XJConf.exceptions.ValueConversionException; 4 import net.schst.XJConf.exceptions.XJConfException; 4 5 5 6 /** … … 22 23 * @param name 23 24 */ 24 public ChildDefinition(String name) { 25 public ChildDefinition(String name) 26 throws XJConfException { 27 if (name == null) { 28 throw new XJConfException("ChildDefinition needs a name."); 29 } 25 30 this.name = name; 26 31 } trunk/src/net/schst/XJConf/DefinitionParser.java
r34 r35 88 88 TagDefinition def; 89 89 String type = atts.getValue("type"); 90 if (type != null) { 91 def = new TagDefinition(atts.getValue("name"), type); 92 } else { 93 def = new TagDefinition(atts.getValue("name"), atts.getValue("primitive")); 94 } 95 90 if (type == null) { 91 type = atts.getValue("primitive"); 92 } 93 def = new TagDefinition(atts.getValue("name"), type); 96 94 // key attribute 97 95 String keyAtt = atts.getValue("keyAttribute"); … … 147 145 Definition def = (Definition)this.defStack.pop(); 148 146 try { 149 AttributeDefinition attDef = new AttributeDefinition(atts.getValue("name"), atts.getValue("type")); 147 String type = atts.getValue("type"); 148 if (type == null) { 149 type = atts.getValue("primitive"); 150 } 151 AttributeDefinition attDef = new AttributeDefinition(atts.getValue("name"), type); 150 152 151 153 // setter method trunk/src/net/schst/XJConf/TagDefinition.java
r32 r35 6 6 7 7 import net.schst.XJConf.exceptions.ValueConversionException; 8 import net.schst.XJConf.exceptions.XJConfException; 8 9 9 10 /** … … 31 32 * @param type 32 33 */ 33 public TagDefinition(String name, String type) { 34 public TagDefinition(String name, String type) 35 throws XJConfException { 36 37 if (name == null) { 38 throw new XJConfException("TagDefinition needs a name."); 39 } 40 if (type == null) { 41 throw new XJConfException("TagDefinition needs a type."); 42 } 43 34 44 this.name = name; 35 45 this.tagName = name;
