org.w3c.mwi.mobileok.basic
Class MobileOKDecodedContentFactory

java.lang.Object
  extended by org.w3c.mwi.mobileok.basic.MobileOKDecodedContentFactory
All Implemented Interfaces:
DecodedContentFactory

public class MobileOKDecodedContentFactory
extends java.lang.Object
implements DecodedContentFactory

mobileOK decoded content factory implementation.

The factory can create the following DecodedContent instances:

The decision to create a given specific instance is triggered by the current context (e.g. primary resources are supposed to be XHTML pages in mobileOK), and by the received content-type (e.g. for images)

Version:
$Revision: 1.1 $
Author:
Francois Daoust

Constructor Summary
MobileOKDecodedContentFactory()
          Creates an instance of the factory.
 
Method Summary
 DecodedContent decodeContent(java.net.URI uri, java.util.List<RetrievalElement> retrieved, ResourceContext resourceContext)
          Creates an instance of a Resource based on the given parameters.
 boolean isContentSupported(java.lang.String contentType, ResourceContext resourceContext)
          Returns true when the factory is able to create content that match the given content-type under the given context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MobileOKDecodedContentFactory

public MobileOKDecodedContentFactory()
Creates an instance of the factory.

Method Detail

decodeContent

public DecodedContent decodeContent(java.net.URI uri,
                                    java.util.List<RetrievalElement> retrieved,
                                    ResourceContext resourceContext)
                             throws TestException
Description copied from interface: DecodedContentFactory
Creates an instance of a Resource based on the given parameters.

Specified by:
decodeContent in interface DecodedContentFactory
Parameters:
uri - absolute URI of the resource.
retrieved - the retrieved representation of the resource.
resourceContext - the context that gave birth to the resource.
Returns:
a Resource that best match the retrieved one, cannot be null.
Throws:
TestException - an unexpected error occurred while retrieving the resource.

isContentSupported

public boolean isContentSupported(java.lang.String contentType,
                                  ResourceContext resourceContext)
Description copied from interface: DecodedContentFactory
Returns true when the factory is able to create content that match the given content-type under the given context.

Specified by:
isContentSupported in interface DecodedContentFactory
Parameters:
contentType - Content-Type to check
resourceContext - Context under which the resource would be created
Returns:
true when the content-type is supported, false otherwise