T- the object to transform into a Resource Type
@Role public interface ResourceTypeResolver<T>
Note that you could wonder why this interface is required when the
ResourceReferenceResolver interface returns a
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.
ResourceType resolve(T representation, Map<String,Object> parameters) throws CreateResourceTypeException
representation- the object to transform into a
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.
CreateResourceTypeException- if there was an error while creating the Resource Type object (the representation doesn't contain a valid Resource Type for example)
Copyright © 2004–2021 XWiki. All rights reserved.