1
2
3
4
5
6
7
8
9
10
11
12
13
14 package org.abstracthorizon.danube.beanconsole;
15
16
17
18
19
20
21 public class BeanDef {
22
23
24 public static final String NO_ACCESS = "-";
25
26
27 public static final String RO = "RO";
28
29
30 public static final String RW = "RW";
31
32
33 public static final String WO = "WO";
34
35
36 public static final String RW_RAW = "rw";
37
38
39 public static final String RO_RAW = "ro";
40
41
42 public static final String WO_RAW = "wo";
43
44
45 public static final int MAX_VALUE_SIZE = 70;
46
47
48 public static final int MAX_TYPE_SIZE = 16;
49
50
51 protected String name;
52
53
54 protected String desc;
55
56
57 protected String type;
58
59
60 protected String shortType;
61
62
63 protected String access;
64
65
66 protected String value;
67
68
69 protected String shortValue;
70
71
72 protected boolean followable;
73
74
75
76
77
78
79
80
81
82 public BeanDef(String name, String desc, String type, String access, String value, boolean followable) {
83 this.name = name;
84 this.desc = desc;
85 this.type = type;
86 this.access = access;
87 this.value = value;
88 this.followable = followable;
89
90 if (value.length() > MAX_VALUE_SIZE) {
91 shortValue = value.substring(0, MAX_VALUE_SIZE) + "...";
92 } else {
93 shortValue = value;
94 }
95
96 if (type.length() > MAX_TYPE_SIZE) {
97 int i = type.indexOf('.');
98 int j = type.lastIndexOf('.');
99 if (i+4 >= j) {
100 shortType = type;
101 } else {
102 shortType = type.substring(0, i+4) + ".." + type.substring(j);
103 }
104
105
106 } else {
107 shortType = type;
108 }
109 }
110
111
112
113
114
115 public String getName() {
116 return name;
117 }
118
119
120
121
122
123 public String getDesc() {
124 return desc;
125 }
126
127
128
129
130
131 public String getType() {
132 return type;
133 }
134
135
136
137
138
139 public String getShortType() {
140 return shortType;
141 }
142
143
144
145
146
147 public String getAccess() {
148 return access;
149 }
150
151
152
153
154
155 public String getValue() {
156 return value;
157 }
158
159
160
161
162
163 public String getShortValue() {
164 return shortValue;
165 }
166
167
168
169
170
171 public boolean isFollowable() {
172 return followable;
173 }
174
175
176
177
178
179 public boolean getFollowable() {
180 return followable;
181 }
182 }