use of org.xwiki.url.ExtendedURL in project xwiki-platform by xwiki.
the class DefaultResourceReferenceSerializer method serialize.
@Override
public ExtendedURL serialize(ResourceReference resource) throws SerializeResourceReferenceException, UnsupportedResourceReferenceException {
ResourceReferenceSerializer<ResourceReference, ExtendedURL> serializer;
ParameterizedType type = new DefaultParameterizedType(null, ResourceReferenceSerializer.class, ResourceReference.class, ExtendedURL.class);
try {
serializer = this.componentManager.getInstance(type, this.urlContextManager.getURLFormatId());
} catch (ComponentLookupException e) {
throw new UnsupportedResourceReferenceException(String.format("Invalid URL format id [%s]. Cannot serialize Resource Reference [%s].", this.urlContextManager.getURLFormatId(), resource), e);
}
return serializer.serialize(resource);
}
Aggregations