use of com.linkedin.restli.server.annotations.RestLiActions in project rest.li by linkedin.
the class RestLiAnnotationReader method processActions.
private static ResourceModel processActions(final Class<?> actionResourceClass, ResourceModel parentResourceModel) {
RestLiActions actionsAnno = actionResourceClass.getAnnotation(RestLiActions.class);
String name = actionsAnno.name();
String namespace = actionsAnno.namespace();
ResourceModel actionResourceModel = new // primary key
ResourceModel(// primary key
null, // key key class
null, // key params class
null, // keys
Collections.<Key>emptySet(), // value class
null, // resource class
actionResourceClass, // parent resource class
null, // name
name, // resource type
ResourceType.ACTIONS, // namespace
namespace);
actionResourceModel.setParentResourceModel(parentResourceModel);
for (Method method : actionResourceClass.getDeclaredMethods()) {
// ignore synthetic, type-erased versions of methods
if (method.isSynthetic()) {
continue;
}
addActionResourceMethod(actionResourceModel, method);
}
log.info("Processed actions resource '" + actionResourceClass.getName() + '\'');
return actionResourceModel;
}
Aggregations