eTextReader.OEB
Class OEBItem

java.lang.Object
  extended by eTextReader.OEB.OEBItem

public class OEBItem
extends java.lang.Object

This class encapsulates information about a single resource that is part of the package file. It also contains a mechanism to allow a reading device to identify a replacement resource if it is unable to render the media-type of this resource

Author:
Ryan McFall
See Also:
The Open eBook Publication Structure specification for more information on processing of fallback items

Field Summary
private  java.lang.String fallbackID
           
private  java.lang.String href
           
private  java.lang.String ID
           
private  java.lang.String mediaType
           
private  java.lang.String urlBase
           
 
Constructor Summary
OEBItem(java.lang.String ID, java.lang.String fallbackID, java.lang.String mediaType, java.lang.String urlBase, java.lang.String href)
          Constructs an OEBItem object from the given parameters
 
Method Summary
 java.lang.String getFallbackID()
          Retrieves the unique identifier of another resource that should be used if the reading agent is not capable of handling the media type of this resource
 java.lang.String getHref()
          Retrieves the fully-specified URL for this resource.
 java.lang.String getID()
          Retrieves the unique identifier of this resource
 java.lang.String getMediaType()
          Retrieves the mime type of this resource as specified by the package file
 java.lang.String getRelativeHref()
          Retrieves the value of the href attribute in the package file, without the urlBase prepended to it
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID

private java.lang.String ID

fallbackID

private java.lang.String fallbackID

mediaType

private java.lang.String mediaType

href

private java.lang.String href

urlBase

private java.lang.String urlBase
Constructor Detail

OEBItem

public OEBItem(java.lang.String ID,
               java.lang.String fallbackID,
               java.lang.String mediaType,
               java.lang.String urlBase,
               java.lang.String href)
Constructs an OEBItem object from the given parameters

Parameters:
ID - the resource's unique identifier
fallbackID - the ID of another resource in the package that should be used if the reading agent cannot handle the media type of this resource
mediaType - the mime-type of this resource
urlBase - the location that should be prepended to the href attribute to load the document
href - the relative URL of this resource contained in the package file
Method Detail

getID

public java.lang.String getID()
Retrieves the unique identifier of this resource


getFallbackID

public java.lang.String getFallbackID()
Retrieves the unique identifier of another resource that should be used if the reading agent is not capable of handling the media type of this resource


getMediaType

public java.lang.String getMediaType()
Retrieves the mime type of this resource as specified by the package file


getHref

public java.lang.String getHref()
Retrieves the fully-specified URL for this resource. If the URL specified for the item in the spine is absolute, then it is returned as is. On the other hand, if it is a relative URL, then the return value will be based on the value given for urlBase when this OEBItem was constructed.


getRelativeHref

public java.lang.String getRelativeHref()
Retrieves the value of the href attribute in the package file, without the urlBase prepended to it