@Override
public void process(final ProcessMethodContext processMethodContext) {
// look for annotation on the property
final DescribedAs annotation = Annotations.getAnnotation(processMethodContext.getMethod(), DescribedAs.class);
DescribedAsFacet facet = create(annotation, processMethodContext.getFacetHolder());
if (facet != null) {
FacetUtil.addFacet(facet);
return;
}
// otherwise, look for annotation on the type
final Class<?> returnType = processMethodContext.getMethod().getReturnType();
final DescribedAsFacet returnTypeDescribedAsFacet = getDescribedAsFacet(returnType);
if (returnTypeDescribedAsFacet != null) {
facet = new DescribedAsFacetForMemberDerivedFromType(returnTypeDescribedAsFacet, processMethodContext.getFacetHolder());
FacetUtil.addFacet(facet);
}
}