1 56 57 package org.objectstyle.cayenne.dataview.dvmodeler; 58 59 import java.util.*; 60 import org.jdom.*; 61 62 67 68 public class ObjAttribute extends DVObject { 69 String type = ""; 70 List loadErrors = new ArrayList(); 71 72 public ObjAttribute(Element element) { 73 String attributeValue = element.getAttributeValue("name"); 74 if ((attributeValue == null) || (attributeValue.length() == 0)){ 75 setName(""); 76 loadErrors.add("ObjAttribute has no name<br><br>"); 77 } else { 78 setName(attributeValue); 79 } 80 attributeValue = element.getAttributeValue("type"); 81 if ((attributeValue == null) || (attributeValue.length() == 0)){ 82 type = ""; 83 loadErrors.add( "ObjAttribute \"" + getName() + "\" has no attribute \"type\"<br><br>"); 84 } else { 85 type = attributeValue; 86 } 87 } 88 89 public List getLoadErrors(){ 90 return Collections.unmodifiableList(loadErrors); 91 } 92 93 public String getType(){ 94 return type; 95 } 96 97 public String toString(){ 98 return getName(); 99 } 100 } 101 | Popular Tags |