1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 package org.codehaus.plexus.maven.plugin.report;
26
27 import org.codehaus.doxia.sink.Sink;
28 import org.codehaus.plexus.util.StringUtils;
29 import org.jdom.Element;
30
31
32
33
34
35 public class Requirement
36 {
37 private String role;
38 private String roleHint;
39 private String fieldName;
40
41 public Requirement( Element requireqment )
42 {
43 role = requireqment.getChildTextTrim( "role" );
44 roleHint = requireqment.getChildTextTrim( "roleHint" );
45 fieldName = requireqment.getChildTextTrim( "fieldName" );
46 }
47
48 public String getRole()
49 {
50 return role;
51 }
52
53 public String getRoleHint()
54 {
55 return roleHint;
56 }
57
58 public String getFieldName()
59 {
60 return fieldName;
61 }
62
63 public void print( Sink sink )
64 {
65
66
67
68
69
70
71
72
73
74
75
76 sink.tableRow();
77 sink.tableCell();
78 sink.text( "Role" );
79 sink.tableCell_();
80 sink.tableCell();
81 sink.monospaced();
82 sink.text( role );
83 sink.monospaced_();
84 sink.tableCell_();
85 sink.tableRow_();
86
87 if( StringUtils.isNotEmpty( roleHint ) )
88 {
89 sink.tableRow();
90 sink.tableCell();
91 sink.text( "Hint" );
92 sink.tableCell_();
93 sink.tableCell();
94 sink.monospaced();
95 sink.text( roleHint );
96 sink.monospaced_();
97 sink.tableCell_();
98 sink.tableRow_();
99 }
100
101 if( StringUtils.isNotEmpty( fieldName ) )
102 {
103 sink.tableRow();
104 sink.tableCell();
105 sink.text( "Field name" );
106 sink.tableCell_();
107 sink.tableCell();
108 sink.monospaced();
109 sink.text( fieldName );
110 sink.monospaced_();
111 sink.tableCell_();
112 sink.tableRow_();
113 }
114 }
115 }