@Override public String getName() { return delegate.getName(); }
public Object exec(List list) throws TemplateModelException { if (list.size() < 1) { throw new TemplateModelException("The uniqueMediaTypesFor method must have a parameter."); } TemplateModel from = (TemplateModel) list.get(0); Object unwrapped = new BeansWrapperBuilder(Configuration.DEFAULT_INCOMPATIBLE_IMPROVEMENTS).build().unwrap(from); Map<String, Parameter> uniquePathParams = new HashMap<String, Parameter>(); if (unwrapped instanceof Resource) { Resource entity = (Resource) unwrapped; List<? extends Method> methods = entity.getMethods(); if (methods != null) { for (Method method : methods) { List<? extends Parameter> params = method.getParameters(); if (params != null) { for (Parameter param : params) { if (param.getTypeLabel().equals("path")) { uniquePathParams.put(param.getName(), param); } } } } } } return uniquePathParams.values(); } }
public Object exec(List list) throws TemplateModelException { if (list.size() < 1) { throw new TemplateModelException("The uniqueMediaTypesFor method must have a parameter."); } TemplateModel from = (TemplateModel) list.get(0); Object unwrapped = new BeansWrapperBuilder(Configuration.DEFAULT_INCOMPATIBLE_IMPROVEMENTS).build().unwrap(from); Map<String, Parameter> uniquePathParams = new HashMap<String, Parameter>(); if (unwrapped instanceof Resource) { Resource entity = (Resource) unwrapped; List<? extends Method> methods = entity.getMethods(); if (methods != null) { for (Method method : methods) { List<? extends Parameter> params = method.getParameters(); if (params != null) { for (Parameter param : params) { if (param.getTypeLabel().equals("path")) { uniquePathParams.put(param.getName(), param); } } } } } } return uniquePathParams.values(); } }