Search in sources :

Example 1 with RestLiActions

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;
}
Also used : RestLiActions(com.linkedin.restli.server.annotations.RestLiActions) RestMethod(com.linkedin.restli.server.annotations.RestMethod) ResourceMethod(com.linkedin.restli.common.ResourceMethod) Method(java.lang.reflect.Method)

Aggregations

ResourceMethod (com.linkedin.restli.common.ResourceMethod)1 RestLiActions (com.linkedin.restli.server.annotations.RestLiActions)1 RestMethod (com.linkedin.restli.server.annotations.RestMethod)1 Method (java.lang.reflect.Method)1