From: <mar...@us...> - 2008-03-14 13:54:49
|
Revision: 1785 http://daisymfc.svn.sourceforge.net/daisymfc/?rev=1785&view=rev Author: markusgy Date: 2008-03-14 06:54:40 -0700 (Fri, 14 Mar 2008) Log Message: ----------- Added getCustomTestIDs method Modified Paths: -------------- trunk/dmfc/src/org/daisy/util/fileset/impl/SmilFileImpl.java trunk/dmfc/src/org/daisy/util/fileset/impl/Z3986SmilFileImpl.java trunk/dmfc/src/org/daisy/util/fileset/interfaces/xml/z3986/Z3986SmilFile.java Modified: trunk/dmfc/src/org/daisy/util/fileset/impl/SmilFileImpl.java =================================================================== --- trunk/dmfc/src/org/daisy/util/fileset/impl/SmilFileImpl.java 2008-03-14 13:53:29 UTC (rev 1784) +++ trunk/dmfc/src/org/daisy/util/fileset/impl/SmilFileImpl.java 2008-03-14 13:54:40 UTC (rev 1785) @@ -21,6 +21,7 @@ import java.io.IOException; import java.net.URI; +import java.util.Set; import javax.xml.namespace.QName; import javax.xml.parsers.ParserConfigurationException; @@ -44,6 +45,8 @@ private SmilClock audioClipBegin = null; //does not gather anything outside startelement; here for optim private SmilClock audioClipEnd = null; //does not gather anything outside startelement; here for optim private long myCalculatedDuration = 0; + /** id attr values of any occuring customTest elements in head */ + protected Set<String> mCustomTestIDs = null; SmilFileImpl(URI uri, String mimeStringConstant) throws ParserConfigurationException, SAXException, IOException { super(uri, mimeStringConstant); @@ -63,6 +66,10 @@ if (attrName == "id") { QName q = new QName(namespaceURI, sName); this.putIdAndQName(attrValue, q); + if(sName=="customTest") { + //the element customTest in head, not the attribute in body + mCustomTestIDs.add(attrValue); + } } else if (FilesetRegex.getInstance().matches(FilesetRegex.getInstance().SMIL_ATTRIBUTES_WITH_URIS, attrName)) { putUriValue(attrValue); } @@ -105,6 +112,7 @@ audioClipEnd = null; } } + } public SmilClock getCalculatedDuration() { Modified: trunk/dmfc/src/org/daisy/util/fileset/impl/Z3986SmilFileImpl.java =================================================================== --- trunk/dmfc/src/org/daisy/util/fileset/impl/Z3986SmilFileImpl.java 2008-03-14 13:53:29 UTC (rev 1784) +++ trunk/dmfc/src/org/daisy/util/fileset/impl/Z3986SmilFileImpl.java 2008-03-14 13:54:40 UTC (rev 1785) @@ -21,6 +21,8 @@ import java.io.IOException; import java.net.URI; +import java.util.HashSet; +import java.util.Set; import javax.xml.parsers.ParserConfigurationException; @@ -35,11 +37,16 @@ public Z3986SmilFileImpl(URI uri) throws ParserConfigurationException, SAXException, IOException { super(uri,Z3986SmilFile.mimeStringConstant); + mCustomTestIDs = new HashSet<String>(); } public SmilClock getStatedTotalElapsedTime() { return myStatedTotalElapsedTime; } + public Set<String> getCustomTestIDs() { + return mCustomTestIDs; + } + private static final long serialVersionUID = 1360195717746938439L; } Modified: trunk/dmfc/src/org/daisy/util/fileset/interfaces/xml/z3986/Z3986SmilFile.java =================================================================== --- trunk/dmfc/src/org/daisy/util/fileset/interfaces/xml/z3986/Z3986SmilFile.java 2008-03-14 13:53:29 UTC (rev 1784) +++ trunk/dmfc/src/org/daisy/util/fileset/interfaces/xml/z3986/Z3986SmilFile.java 2008-03-14 13:54:40 UTC (rev 1785) @@ -19,6 +19,8 @@ package org.daisy.util.fileset.interfaces.xml.z3986; +import java.util.Set; + import org.daisy.util.fileset.interfaces.xml.SmilFile; import org.daisy.util.mime.MIMEConstants; import org.daisy.util.xml.SmilClock; @@ -34,4 +36,10 @@ * @return if given, the stated value for TotalElapsedTime (==time prior to onset of this smil file). */ public SmilClock getStatedTotalElapsedTime(); + + /** + * Get the id values of any occurring customTest elements in this SMIL files head. + * If this SMIL file contains no customTest elements, and empty Set is returned. + */ + public Set<String> getCustomTestIDs(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |