String desc = t.getDescription();
String id = t.getId();
String use = t.getUsage();
AnnotationDefinition dest = null;
if (t.isSetListAnnotation()) {
XBELListAnnotation listAnnotation = t.getListAnnotation();
List<String> vals = listAnnotation.getListValue();
dest = new AnnotationDefinition(id, desc, use, vals);
} else if (t.isSetPatternAnnotation()) {
String regex = t.getPatternAnnotation();
dest = new AnnotationDefinition(id, REGULAR_EXPRESSION, desc, use);
dest.setValue(regex);
} else {
throw new UnsupportedOperationException("unhandled");
}
return dest;