use of org.xwiki.rest.url.ParametrizedRestURLGenerator in project xwiki-platform by xwiki.
the class DefaultRestURLGenerator method getURL.
@Override
public URL getURL(EntityReference entityReference) throws XWikiRestException {
try {
ParameterizedType type = new DefaultParameterizedType(null, ParametrizedRestURLGenerator.class, entityReference.getClass());
ParametrizedRestURLGenerator parametrizedRestURLGenerator = componentManager.getInstance(type);
return parametrizedRestURLGenerator.getURL(entityReference);
} catch (ComponentLookupException e) {
throw new XWikiRestException(String.format("Unsupported entity type: [%s]", entityReference.getClass()), e);
}
}
Aggregations