예제 #1
0
 public Collection<RestfulMapping> getMappingsByHandler(Class<?> handlerClass) {
   Collection<RestfulMapping> mappings = new LinkedHashSet<RestfulMapping>();
   for (RestfulMapping restfulMapping : this.getMappings()) {
     if (restfulMapping.getBeanClass().equals(handlerClass)) {
       mappings.add(restfulMapping);
     }
   }
   return mappings;
 }
예제 #2
0
 public boolean isMapped(RestfulMapping mapping) {
   boolean mapped = false;
   for (RestfulMapping cachedMapping : this.cache.values()) {
     mapped =
         CollectionUtils.containsAny(cachedMapping.getUrls(), mapping.getUrls())
             && CollectionUtils.containsAny(
                 cachedMapping.getHttpMethods(), mapping.getHttpMethods());
     if (mapped) {
       break;
     }
   }
   return mapped;
 }
예제 #3
0
 public void add(String id, RestfulMapping mapping) {
   this.cache.put(id, mapping);
   this.mappedHandlers.add(mapping.getBeanClass());
 }