Package org.xwiki.resource
Interface ResourceTypeResolver<T>
-
- Type Parameters:
T- the object to transform into a Resource Type
@Role public interface ResourceTypeResolver<T>Transforms some representation of an XWiki Resource Type into aResourceTypeinstance.Note that you could wonder why this interface is required when the
ResourceReferenceResolverinterface returns aResourceReferencewhich itself provides that Type throughResourceReference.getType()method. The reason is that some code needs to find out the Resource Type without parsing the full representation before taking some decision. This is the case for example for the XWiki Routing Filter which needs to decide how to perform the routing based on the Resource Type. That code is executed when there's no Execution Context yet and thus resolving the full Resource Reference would fail since it requires some valid Execution Context to extract the wiki name from the URL.- Since:
- 7.1M1
- Version:
- $Id: 0cfa838156233d7af50bef31eedd19e0748e0548 $
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ResourceTyperesolve(T representation, Map<String,Object> parameters)Transforms some representation of a XWiki Resource Type into aResourceTypeinstance.
-
-
-
Method Detail
-
resolve
ResourceType resolve(T representation, Map<String,Object> parameters) throws CreateResourceTypeException
Transforms some representation of a XWiki Resource Type into aResourceTypeinstance.- Parameters:
representation- the object to transform into aResourceTypeinstanceparameters- generic parameters that depend on the underlying implementation. In order to know what to pass you need to check the documentation for the implementation you're using.- Returns:
- the
ResourceTypeinstance - Throws:
CreateResourceTypeException- if there was an error while creating the Resource Type object (the representation doesn't contain a valid Resource Type for example)
-
-