/** * Return the {@code T} annotation object from this field if it exist; otherwise returns * {@code null}. * * @param annotation the class of the annotation that will be retrieved * @return the annotation instance if it is bound to the field; otherwise {@code null} */ public <T extends Annotation> T getAnnotation(Class<T> annotation) { return getAnnotationFromArray(getAnnotations(), annotation); }
@Override public boolean shouldSkipField(FieldAttributes f) { return f.getAnnotations().contains(Transient.class) || f.hasModifier(Modifier.TRANSIENT); }
public final String translateName(FieldAttributes f) { return translateName(f.getName(), f.getDeclaredType(), f.getAnnotations()); }
@Override public boolean shouldSkipField(FieldAttributes fieldAttributes) { Collection<Annotation> annotations = fieldAttributes.getAnnotations(); for (Annotation a : annotations) { if (ServiceDocument.UsageOptions.class.equals(a.annotationType())) { ServiceDocument.UsageOptions usageOptions = (ServiceDocument.UsageOptions) a; for (ServiceDocument.UsageOption usageOption : usageOptions.value()) { if (usageOption.option().equals(ServiceDocumentDescription.PropertyUsageOption.SENSITIVE)) { return true; } } } else if (ServiceDocument.UsageOption.class.equals(a.annotationType())) { ServiceDocument.UsageOption usageOption = (ServiceDocument.UsageOption) a; if (usageOption.option().equals(ServiceDocumentDescription.PropertyUsageOption.SENSITIVE)) { return true; } } else if (ServiceDocument.PropertyOptions.class.equals(a.annotationType())) { ServiceDocument.PropertyOptions propertyOptions = (ServiceDocument.PropertyOptions) a; for (ServiceDocumentDescription.PropertyUsageOption propertyUsageOption : propertyOptions.usage()) { if (propertyUsageOption.equals(ServiceDocumentDescription.PropertyUsageOption.SENSITIVE)) { return true; } } } } return false; }