Evolution #3144
Use Annotation map instead of list in visitors
Start date:
10/30/2013
Due date:
% Done:
0%
Estimated time:
Bdc:
Description
In all Java visitors, list of annotations are used, with multiple casts all along. Example :
if (norm.getPairs() != null) {
for (final MemberValuePair mvp
: norm.getPairs()) {
// Argument of Annotation Column
if (annotationType.equals(FILTER_COLUMN)) {
// set nullable
if (mvp.getName().equals(ATTRIBUTE_NULLABLE)
&& mvp.getValue().toString()
.equals(String.valueOf(true))) {
result.setNullable(true);
} else
// set name
if (mvp.getName().equals(ATTRIBUTE_NAME)) {
if (mvp.getValue()
instanceof StringLiteralExpr) {
result.setColumnName(
((StringLiteralExpr)
mvp.getValue()).getValue());
} else {
result.setColumnName(
mvp.getValue().toString());
}
} else [...]
A use of Maps, like :
result.setName(this.map.get(FILTER_COLUMN, ANNOTATION_NAME))
should be a lot nicer !
Recurrences