1 |
|
package org.apache.torque.engine.database.model; |
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
|
import org.xml.sax.Attributes; |
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
@author |
28 |
|
@version |
29 |
|
|
|
|
| 0% |
Uncovered Elements: 29 (29) |
Complexity: 11 |
Complexity Density: 0.65 |
|
30 |
|
public class Inheritance |
31 |
|
{ |
32 |
|
private String key; |
33 |
|
private String className; |
34 |
|
private String ancestor; |
35 |
|
private Column parent; |
36 |
|
|
37 |
|
|
38 |
|
|
39 |
|
|
40 |
|
@param |
41 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
42 |
0
|
public void loadFromXML (Attributes attrib)... |
43 |
|
{ |
44 |
0
|
setKey(attrib.getValue("key")); |
45 |
0
|
setClassName(attrib.getValue("class")); |
46 |
0
|
setAncestor(attrib.getValue("extends")); |
47 |
|
} |
48 |
|
|
49 |
|
|
50 |
|
|
51 |
|
@return |
52 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
53 |
0
|
public String getKey()... |
54 |
|
{ |
55 |
0
|
return key; |
56 |
|
} |
57 |
|
|
58 |
|
|
59 |
|
|
60 |
|
@param |
61 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
62 |
0
|
public void setKey(String v)... |
63 |
|
{ |
64 |
0
|
this.key = v; |
65 |
|
} |
66 |
|
|
67 |
|
|
68 |
|
|
69 |
|
|
70 |
|
@return |
71 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
72 |
0
|
public Column getColumn()... |
73 |
|
{ |
74 |
0
|
return parent; |
75 |
|
} |
76 |
|
|
77 |
|
|
78 |
|
|
79 |
|
@param |
80 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
81 |
0
|
public void setColumn(Column v)... |
82 |
|
{ |
83 |
0
|
this.parent = v; |
84 |
|
} |
85 |
|
|
86 |
|
|
87 |
|
|
88 |
|
@return |
89 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
90 |
0
|
public String getClassName()... |
91 |
|
{ |
92 |
0
|
return className; |
93 |
|
} |
94 |
|
|
95 |
|
|
96 |
|
|
97 |
|
@param |
98 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
99 |
0
|
public void setClassName(String v)... |
100 |
|
{ |
101 |
0
|
this.className = v; |
102 |
|
} |
103 |
|
|
104 |
|
|
105 |
|
|
106 |
|
@return |
107 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
108 |
0
|
public String getAncestor()... |
109 |
|
{ |
110 |
0
|
return ancestor; |
111 |
|
} |
112 |
|
|
113 |
|
|
114 |
|
|
115 |
|
@param |
116 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
117 |
0
|
public void setAncestor(String v)... |
118 |
|
{ |
119 |
0
|
this.ancestor = v; |
120 |
|
} |
121 |
|
|
122 |
|
|
123 |
|
|
124 |
|
|
125 |
|
@return |
126 |
|
|
|
|
| 0% |
Uncovered Elements: 8 (8) |
Complexity: 2 |
Complexity Density: 0.33 |
|
127 |
0
|
public String toString()... |
128 |
|
{ |
129 |
0
|
StringBuffer result = new StringBuffer(); |
130 |
0
|
result.append(" <inheritance key=\"") |
131 |
|
.append(key) |
132 |
|
.append("\" class=\"") |
133 |
|
.append(className) |
134 |
|
.append('\"'); |
135 |
|
|
136 |
|
|
137 |
0
|
if (ancestor != null) |
138 |
|
{ |
139 |
0
|
result.append(" extends=\"") |
140 |
|
.append(ancestor) |
141 |
|
.append('\"'); |
142 |
|
} |
143 |
|
|
144 |
0
|
result.append("/>"); |
145 |
|
|
146 |
0
|
return result.toString(); |
147 |
|
} |
148 |
|
} |