Class ResourceDescriptorValidator

java.lang.Object
org.exoplatform.services.rest.impl.resource.ResourceDescriptorValidator
All Implemented Interfaces:
ResourceDescriptorVisitor

public class ResourceDescriptorValidator extends Object implements ResourceDescriptorVisitor
Validate ResourceDescriptors. @see ResourceDescriptor.accept(ResourceDescriptorVisitor).

Validation Goals:

  • check number of method parameters without annotation, should be not more then one at resource method or sub-resource method and no one at sub-resource locator
  • if one of parameters at resource method or sub-resource method has FormParam annotation then entity type can be only MultivalueMap<String, String> and nothing other
  • PathValue.getPath() can't return empty string, it minds for root resource classes, sub-resource methods and sub-resource locators can't have annotation @Path("")
  • Resource class must contains at least one resource method, sub-resource method or sub-resource locator

Non-Goals:

  • Check does any two resource methods has the same consume and produce media type. This will be done later in binding cycle
  • Check does any two sub-resource methods has the same consume and produce media type and HTTP request method designation. This will be done later in binding cycle
  • Check does two sub-resource locators has the same UriPattern

Version:
$Id: $
Author:
Andrey Parfonov