// Try to resolve annotations, ignore any that fail.
Map<Class<? extends java.lang.annotation.Annotation>, java.lang.annotation.Annotation> declaredAnnotations = newAnnotationMap();
resolveAnnotations(logger, jfield.annotations, declaredAnnotations);
String name = String.valueOf(jfield.name);
JField field;
if (jfield.getKind() == AbstractVariableDeclaration.ENUM_CONSTANT) {
assert (enclosingType.isEnum() != null);
field = new JEnumConstant(enclosingType, name, declaredAnnotations,
jfield.binding.original().id);
} else {
field = new JField(enclosingType, name, declaredAnnotations);
}
// Get modifiers.
//
field.addModifierBits(Shared.bindingToModifierBits(jfield.binding));
// Set the field type.
//
TypeBinding jfieldType = jfield.binding.type;
JType fieldType = resolveType(logger, jfieldType);
if (fieldType == null) {
// Unresolved type.
//
return false;
}
field.setType(fieldType);
// Get tags.
//
if (jfield.javadoc != null) {
if (!parseMetaDataTags(unitSource, field, jfield.javadoc)) {