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 a ResourceType instance.

    Note that you could wonder why this interface is required when the ResourceReferenceResolver interface returns a ResourceReference which itself provides that Type through ResourceReference.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 Detail

      • resolve

        ResourceType resolve​(T representation,
                             Map<String,​Object> parameters)
                      throws CreateResourceTypeException
        Transforms some representation of a XWiki Resource Type into a ResourceType instance.
        Parameters:
        representation - the object to transform into a ResourceType instance
        parameters - 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 ResourceType instance
        Throws:
        CreateResourceTypeException - if there was an error while creating the Resource Type object (the representation doesn't contain a valid Resource Type for example)