1 package org.apache.torque.engine.database.model; 2 3 18 19 import org.xml.sax.Attributes ; 20 21 27 public class Inheritance 28 { 29 private String key; 30 private String className; 31 private String ancestor; 32 private Column parent; 33 34 39 public void loadFromXML (Attributes attrib) 40 { 41 setKey(attrib.getValue("key")); 42 setClassName(attrib.getValue("class")); 43 setAncestor(attrib.getValue("extends")); 44 } 45 46 50 public String getKey() 51 { 52 return key; 53 } 54 55 59 public void setKey(String v) 60 { 61 this.key = v; 62 } 63 64 65 69 public Column getColumn() 70 { 71 return parent; 72 } 73 74 78 public void setColumn(Column v) 79 { 80 this.parent = v; 81 } 82 83 87 public String getClassName() 88 { 89 return className; 90 } 91 92 96 public void setClassName(String v) 97 { 98 this.className = v; 99 } 100 101 105 public String getAncestor() 106 { 107 return ancestor; 108 } 109 110 114 public void setAncestor(String v) 115 { 116 this.ancestor = v; 117 } 118 119 124 public String toString() 125 { 126 StringBuffer result = new StringBuffer (); 127 result.append(" <inheritance key=\"") 128 .append(key) 129 .append("\" class=\"") 130 .append(className) 131 .append('\"'); 132 133 134 if (ancestor != null) 135 { 136 result.append(" extends=\"") 137 .append(ancestor) 138 .append('\"'); 139 } 140 141 result.append("/>"); 142 143 return result.toString(); 144 } 145 } 146 | Popular Tags |