org.xwiki.resource
Interface ResourceFactory<T,U extends Resource>

Type Parameters:
T - the object to transform into a XWiki Resource
U - the return type (e.g. Resource, EntityResource, etc)

@Role
@Unstable
public interface ResourceFactory<T,U extends Resource>

Transforms some representation of an XWiki Resource into a Resource instance.

Since:
5.3M1
Version:
$Id: 438e1f9dffffa255d55533ad097f6a25e54f8d6a $

Field Summary
static ParameterizedType TYPE_URL_RESOURCE
          Type instance for ResourceFactory<URL, Resource>.
 
Method Summary
 U createResource(T representation, Map<String,Object> parameters)
          Transforms some representation of a XWiki Resource into a Resource instance.
 

Field Detail

TYPE_URL_RESOURCE

static final ParameterizedType TYPE_URL_RESOURCE
Type instance for ResourceFactory<URL, Resource>.

Method Detail

createResource

U createResource(T representation,
                 Map<String,Object> parameters)
                                  throws ResourceCreationException,
                                         UnsupportedResourceException
Transforms some representation of a XWiki Resource into a Resource instance.

Parameters:
representation - the object to transform into a Resource 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 Resource instance
Throws:
ResourceCreationException - if there was an error while creating the XWiki Resource object
UnsupportedResourceException - if the passed representation points to an unsupported Resource type that we don't know how to parse


Copyright © 2004–2014 XWiki. All rights reserved.