org.daisy.zedval.engine
Class ResourceFile

java.lang.Object
  extended byjava.io.File
      extended byorg.daisy.zedval.engine.ZedFile
          extended byorg.daisy.zedval.engine.ManifestFile
              extended byorg.daisy.zedval.engine.XmlFile
                  extended byorg.daisy.zedval.engine.ResourceFile
All Implemented Interfaces:
java.lang.Comparable, org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler, org.xml.sax.ext.LexicalHandler, Referring, java.io.Serializable

public class ResourceFile
extends XmlFile

A ResourceFile object represents a DTB resource file

Author:
James Pritchett, Markus Gylling
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.daisy.zedval.engine.ManifestFile
MIME_JPEG, MIME_MP3, MIME_NCX, MIME_PACKAGE, MIME_PNG, MIME_RESOURCE, MIME_SMIL, MIME_SVG, MIME_TEXT, MIME_WAV, MIME_AAC
 
Fields inherited from class java.io.File
pathSeparator, pathSeparatorChar, separator, separatorChar
 
Constructor Summary
ResourceFile(java.lang.String fullPath, java.lang.String id, java.lang.String mimeType)
           
 
Method Summary
 java.util.HashMap getFileRefs()
          Returns a HashMap of all files referenced by this file
 boolean hasNsUri(java.lang.String nsURI)
           
 void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)
          Grabs all incoming elements and looks for properties to set
 
Methods inherited from class org.daisy.zedval.engine.XmlFile
characters, comment, endCDATA, endDocument, endDTD, endElement, endEntity, endPrefixMapping, error, fatalError, getAllValidationErrors, getDoctypeName, getDoctypePublicId, getDoctypeSystemId, getRootElementLocalName, getRootElementNsURI, getValidationErrors, getValidationFatalErrors, getValidationWarnings, getXmlFileElementById, getXmlFileElements, hasIDValue, ignorableWhitespace, initialize, isParsed, isValid, isValidated, isWellFormed, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startCDATA, startDocument, startDTD, startEntity, startPrefixMapping, toString, unparsedEntityDecl, warning
 
Methods inherited from class org.daisy.zedval.engine.ManifestFile
getId, getMimeType, getPackage, setID, setMimeType, setPackage
 
Methods inherited from class org.daisy.zedval.engine.ZedFile
getName
 
Methods inherited from class java.io.File
canRead, canWrite, compareTo, compareTo, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, equals, exists, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getParent, getParentFile, getPath, hashCode, isAbsolute, isDirectory, isFile, isHidden, lastModified, length, list, list, listFiles, listFiles, listFiles, listRoots, mkdir, mkdirs, renameTo, setLastModified, setReadOnly, toURI, toURL
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ResourceFile

public ResourceFile(java.lang.String fullPath,
                    java.lang.String id,
                    java.lang.String mimeType)
Parameters:
id - id from package file manifest
fullPath - File path
mimeType - File MIME type as given in package manifest
Method Detail

getFileRefs

public java.util.HashMap getFileRefs()
Returns a HashMap of all files referenced by this file

Returns:
A HashMap of File objects (key = abolute path)

startElement

public void startElement(java.lang.String namespaceURI,
                         java.lang.String localName,
                         java.lang.String qName,
                         org.xml.sax.Attributes atts)
Grabs all incoming elements and looks for properties to set

Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class XmlFile
Parameters:
namespaceURI - The namespace URI of the element
localName - The non-prefixed name of the element
qName - The qualified name of the element
atts - List of all element attributes

hasNsUri

public boolean hasNsUri(java.lang.String nsURI)
Returns:
true if this file has a scope element with an nsuri attr valued as the input param, false otherwise note- for z2002 DTBs, this test will always return false