private void setAnnotations( AbstractJavaEntity entity ) {
if( !currentAnnoDefs.isEmpty() ) {
Annotation[] annotations = new Annotation[currentAnnoDefs.size()];
int index = 0;
for (Iterator iter = currentAnnoDefs.iterator(); iter.hasNext();) {
AnnoDef def = (AnnoDef)iter.next();
annotations[index++] = buildAnnotation( def, entity );
}
entity.setAnnotations( annotations );
currentAnnoDefs.clear();