org.daisy.zedval.engine
Class TextFile

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.TextFile
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 TextFile
extends XmlFile

A TextFile object represents a DTB textual content file

Author:
James Pritchett, Piotr Kiernicki, mgylling
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
TextFile(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
 java.lang.String getUid()
           
 XmlFileElement getXmlFileElementBySmilrefValue(java.lang.String smilrefValue)
           
 java.util.Collection getXmlFileElementsWithSmilrefAttrs()
           
 void processingInstruction(java.lang.String target, java.lang.String data)
           
 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, 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

TextFile

public TextFile(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 = absolute full 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

processingInstruction

public void processingInstruction(java.lang.String target,
                                  java.lang.String data)
Specified by:
processingInstruction in interface org.xml.sax.ContentHandler
Overrides:
processingInstruction in class XmlFile

getUid

public java.lang.String getUid()

getXmlFileElementBySmilrefValue

public XmlFileElement getXmlFileElementBySmilrefValue(java.lang.String smilrefValue)
Parameters:
smilrefValue - a string that may or may not be the value of an attribute named smilref in this TextFile
Returns:
an XmlFileElement (=element of this textfile) that matches the inparam smilref value, null if no match

getXmlFileElementsWithSmilrefAttrs

public java.util.Collection getXmlFileElementsWithSmilrefAttrs()
Returns:
a Collection<XmlFileElement> of those elements in in this TextFile that carry a smilref attribute