org.w3c.mwi.mobileok.basic
Class NotSupportedImageContent

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

public class NotSupportedImageContent
extends ImageContent

Represents a image/jpeg image resource.

Version:
$Revision: 1.1 $
Author:
The W3C mobileOK Checker Task Force

Field Summary
private  java.lang.String imageType
          Content-type of the image.
 
Constructor Summary
NotSupportedImageContent(java.net.URI uri, java.util.List<RetrievalElement> retrieved)
          Creates a class instance bound to a URI.
 
Method Summary
 java.util.List<ValidationByteMessage> getImageErrorMessageList()
          Returns the list of image format validation error messages.
 int getImageHeight()
          Returns the height of the image.
 java.lang.String getImageType()
          Returns the image content-type.
 int getImageWidth()
          Returns the width of the image.
 boolean hasTransparency()
          Returns true when the image uses transparency.
 boolean isValid()
          Returns true when the content could be successfully decoded.
 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
 

Field Detail

imageType

private final java.lang.String imageType
Content-type of the image.

Constructor Detail

NotSupportedImageContent

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

The content is validated while it is instantiated.

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

getImageHeight

public int getImageHeight()
Description copied from class: ImageContent
Returns the height of the image.

Specified by:
getImageHeight in class ImageContent
Returns:
the height of the image, in pixels.

getImageWidth

public int getImageWidth()
Description copied from class: ImageContent
Returns the width of the image.

Specified by:
getImageWidth in class ImageContent
Returns:
the width of the image, in pixels.

hasTransparency

public boolean hasTransparency()
Description copied from class: ImageContent
Returns true when the image uses transparency.

Support for transparency may depend on the image format. A false may thus also mean that transparency simply cannot be used.

Specified by:
hasTransparency in class ImageContent
Returns:
true when the image uses transparency, false otherwise.

isValid

public boolean isValid()
Description copied from class: DecodedContent
Returns true when the content could be successfully decoded.

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

getImageErrorMessageList

public java.util.List<ValidationByteMessage> getImageErrorMessageList()
Description copied from class: ImageContent
Returns the list of image format validation error messages.

Specified by:
getImageErrorMessageList in class ImageContent
Returns:
the list of validation error messages.

getImageType

public java.lang.String getImageType()
Description copied from class: ImageContent
Returns the image content-type.

Specified by:
getImageType in class ImageContent
Returns:
the image type

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.

Overrides:
toMokiNode in class ImageContent
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.