internal.org.springframework.content.rest.mappingcontext.RequestMappingToLinkrelMappingContext Maven / Gradle / Ivy
package internal.org.springframework.content.rest.mappingcontext;
import org.springframework.content.commons.mappingcontext.ClassWalker;
import java.util.HashMap;
import java.util.Map;
public class RequestMappingToLinkrelMappingContext {
private Map, Map> mappings = new HashMap, Map>();
public RequestMappingToLinkrelMappingContext() {}
public Map getMappings(Class> domainClass) {
Map mappings = this.mappings.get(domainClass);
if (mappings == null) {
mappings = resolveMappings(domainClass);
}
return mappings;
}
private Map resolveMappings(Class> domainClass) {
RequestMappingToLinkrelMappingBuilder visitor = new RequestMappingToLinkrelMappingBuilder();
ClassWalker walker = new ClassWalker(visitor);
walker.accept(domainClass);
Map mappings = visitor.getRequestMappings();
this.mappings.put(domainClass, mappings);
return mappings;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy