Пример #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());
 }