org.w3c.mwi.mobileok.basic
Class NotSupportedContent

java.lang.Object
  extended by org.w3c.mwi.mobileok.basic.DecodedContent
      extended by org.w3c.mwi.mobileok.basic.NotSupportedContent

public class NotSupportedContent
extends DecodedContent

Class that represents a resource whose content-type is not supported, or whose content-type is not supported within the context of the resource.

An instance of this class must be returned by the DecodedContentFactory being used when there is no more appropriate decoded content.

For instance, mobileOK only accepts image/gif and image/jpeg for ResourceContext.Image resources. An instance of this class will thus be returned whenever an image with a different content-type is created.

Version:
$Revision: 1.1 $
Author:
Francois Daoust

Constructor Summary
NotSupportedContent(java.net.URI uri, java.util.List<RetrievalElement> retrieved)
          Creates a class instance bound to a URI.
 
Method Summary
 boolean isValid()
          Returns false because not supported content is de facto not valid.
 org.w3c.dom.Node toMokiNode(org.w3c.dom.Document document, org.w3c.dom.Node parent)
          Serializes the content to its moki representation as a DOM node.
 
Methods inherited from class org.w3c.mwi.mobileok.basic.DecodedContent
addByteErrorMessages, addLineAndColumnMessages
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NotSupportedContent

public NotSupportedContent(java.net.URI uri,
                           java.util.List<RetrievalElement> retrieved)
                    throws TestException
Creates a class instance bound to a URI.

Parameters:
uri - absolute URI of the resource.
retrieved - the retrieved representation of the resource.
Throws:
TestException - an unexpected error occurred while retrieving the resource.
Method Detail

isValid

public boolean isValid()
Returns false because not supported content is de facto not valid.

Specified by:
isValid in class DecodedContent
Returns:
true when the content is valid, false otherwise.

toMokiNode

public org.w3c.dom.Node toMokiNode(org.w3c.dom.Document document,
                                   org.w3c.dom.Node parent)
Description copied from class: DecodedContent
Serializes the content to its moki representation as a DOM node.

Specified by:
toMokiNode in class DecodedContent
Parameters:
document - DOM document the created node should belong to
parent - DOM node to which the representation should be appended.
Returns:
the moki representation of the resource as a DOM node.