public void setDeclarationMethod(JMethod declarationMethod) {
toReturn.declarationMethod = declarationMethod;
JClassType returnClass = declarationMethod.getReturnType().isClassOrInterface();
JsonRpcWireName annotation = returnClass == null ? null
: returnClass.getAnnotation(JsonRpcWireName.class);
if (annotation == null) {
toReturn.operation = declarationMethod.getEnclosingType().getQualifiedBinaryName()
+ "::" + declarationMethod.getName();
} else {
toReturn.operation = annotation.value();
toReturn.apiVersion = annotation.version();
}
}