T
- the object to transform into a Resource Type@Role
public interface ResourceTypeResolver<T>
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.
Modifier and Type | Method and Description |
---|---|
ResourceType |
resolve(T representation,
Map<String,Object> parameters)
Transforms some representation of a XWiki Resource Type into a
ResourceType instance. |
ResourceType resolve(T representation, Map<String,Object> parameters) throws CreateResourceTypeException
ResourceType
instance.representation
- the object to transform into a ResourceType
instanceparameters
- 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.ResourceType
instanceCreateResourceTypeException
- 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.