| 
 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectviper.descriptors.DescHolder
Implements the DescriptorData interface for the old data file format, as well as the XML format. It supports XML input and output, as well as the old format. This makes it somewhat fragile... there are certain things that can only be done in the XML format that must be avoided for now. Fixme - only supports either one sourcefile w/ no filename or all sourcefiles with a filename
| Field Summary | 
| Fields inherited from interface viper.descriptors.DescriptorData | 
| NAMESPACE_URI | 
| Constructor Summary | |
| DescHolder()Constructs a new, empty descriptor holder. | |
| Method Summary | |
|  boolean | addFileName(java.lang.String S)Adds a new URL/filename to the set that this object describes (Optional). | 
|  DescriptorConfigs | getDescriptorConfigs()Gets the DescriptorConfigsassociated with this data. | 
|  java.util.Iterator | getFileNames()Returns the URL/filenames of all the media this DescriptorData describes. | 
|  DescriptorList | getFlattenedData()Returns the list as one long DescriptorList. | 
|  DescriptorList | getForFile(java.lang.String filename)Return the DescriptorList who describe the media with the specified filename or URL String. | 
|  java.lang.String | getInformation()Returns a string for .raw output summarizing what media files this descriptor uses and so forth. | 
|  Equivalencies | getMap()Gets the Equivalency map for this list. | 
|  org.w3c.dom.Element | getXMLFormat(org.w3c.dom.Document root)Gets the data in ViPER XML format. | 
|  boolean | isMultifile()Determines if this describes more than one media file. | 
|  void | merge(DescriptorData other)Adds the data from the other DescriptorData to this one. | 
|  void | parseData(DescVector data)Parses a DescVector in flat format into a multifile format. | 
|  void | parseData(org.w3c.dom.Document document,
          Equivalencies map,
          RuleHolder limits,
          DescriptorConfigs cfgs,
          java.io.PrintWriter logfile,
          java.lang.String filename)Parses data from an XML DOM document root. | 
|  void | parseData(org.xml.sax.InputSource input,
          Equivalencies map,
          RuleHolder limits,
          DescriptorConfigs cfgs,
          java.io.PrintWriter logfile)Parses data from an XML file. | 
|  void | parseData(java.util.List allFiles,
          DescriptorConfigs cfgs,
          RuleHolder limits,
          Equivalencies map)Parse the data. | 
|  void | parseData(java.util.List allFiles,
          DescriptorConfigs cfgs,
          RuleHolder limits,
          Equivalencies map,
          boolean all,
          boolean err,
          boolean warn,
          boolean bad,
          boolean totals)Parse the data. | 
|  DescriptorList | removeFile(java.lang.String filename)Removes the given file name and its corresponding metadata. | 
|  void | resetIds()Resets all object ids. | 
|  DescriptorList | setDataForFile(java.lang.String S,
               DescriptorList l)Replaces the DesciptorList associated to a given filename with the DescriptorList that is passed in. | 
|  void | setDescriptorConfigs(DescriptorConfigs cfgs)Sets the descriptor schema associated with this holder. | 
|  void | setMap(Equivalencies map)Sets the equivalency map of the list. | 
|  java.lang.String | toString()Gets the data in gtf format | 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Constructor Detail | 
public DescHolder()
| Method Detail | 
public DescriptorConfigs getDescriptorConfigs()
DescriptorDataDescriptorConfigs associated with this data.
getDescriptorConfigs in interface DescriptorDataDescriptorConfigs associated with this datapublic void setDescriptorConfigs(DescriptorConfigs cfgs)
cfgs - the new schemapublic boolean isMultifile()
DescriptorData
isMultifile in interface DescriptorDatatrue if this describes more than one media file
public void parseData(java.util.List allFiles,
                      DescriptorConfigs cfgs,
                      RuleHolder limits,
                      Equivalencies map)
parseData in interface DescriptorDataallFiles - list of file names/paths (String objects)cfgs - the configurationlimits - the rules to use while parsingmap - the equivalency list
public void parseData(java.util.List allFiles,
                      DescriptorConfigs cfgs,
                      RuleHolder limits,
                      Equivalencies map,
                      boolean all,
                      boolean err,
                      boolean warn,
                      boolean bad,
                      boolean totals)
allFiles - list of file names/paths (String objects)cfgs - the configurationlimits - the rules to use while parsingmap - the equivalency listall - display all lineserr - display errorswarn - display warningsbad - display general errorstotals - print error/warning totals at endpublic void parseData(DescVector data)
data - A DescVector to convert to this DescHolderpublic java.lang.String toString()
public DescriptorList getFlattenedData()
DescriptorData
getFlattenedData in interface DescriptorDatapublic DescriptorList getForFile(java.lang.String filename)
DescriptorData
getForFile in interface DescriptorDatafilename - the file to get the metadata of
public java.util.Iterator getFileNames()
DescriptorData
getFileNames in interface DescriptorDatapublic boolean addFileName(java.lang.String S)
DescriptorData
addFileName in interface DescriptorDataS - the name of the file to add
public DescriptorList setDataForFile(java.lang.String S,
                                     DescriptorList l)
DescriptorData
setDataForFile in interface DescriptorDataS - the name of the file to changel - the new value
public DescriptorList removeFile(java.lang.String filename)
DescriptorData
removeFile in interface DescriptorDatafilename - the file to remove
public java.lang.String getInformation()
DescriptorDataDirectory Sequence mapping (list of frame / filename pairs) SEQUENCE | FRAMES Number of Frames
getInformation in interface DescriptorData
public void parseData(org.xml.sax.InputSource input,
                      Equivalencies map,
                      RuleHolder limits,
                      DescriptorConfigs cfgs,
                      java.io.PrintWriter logfile)
               throws java.io.IOException,
                      BadDataException
parseData in interface DescriptorDatainput - the xml input sourcecfgs - if this is null, the parser is looks 
           for the <config> element and generates its own
           config information. If you want to do things
           like limitation parsing and evaluations, you will have 
           to parse the config info first.limits - the rules to use while parsingmap - the equivalency listlogfile - log for the errors/warnings
java.io.IOException
BadDataException
public void parseData(org.w3c.dom.Document document,
                      Equivalencies map,
                      RuleHolder limits,
                      DescriptorConfigs cfgs,
                      java.io.PrintWriter logfile,
                      java.lang.String filename)
               throws java.io.IOException,
                      BadDataException
document - the xml documentcfgs - if this is limits - the rules to use while parsingmap - the equivalency listlogfile - the error writerfilename - the name of the file; useful for error writing
java.io.IOException
BadDataExceptionpublic org.w3c.dom.Element getXMLFormat(org.w3c.dom.Document root)
DescriptorData
getXMLFormat in interface DescriptorDataroot - the document to use while creating the element
public void merge(DescriptorData other)
           throws java.lang.IllegalArgumentException
DescriptorData
merge in interface DescriptorDataother - the data to merge from
java.lang.IllegalArgumentExceptionpublic void resetIds()
DescriptorData
resetIds in interface DescriptorDatapublic Equivalencies getMap()
getMap in interface DescriptorDatapublic void setMap(Equivalencies map)
setMap in interface DescriptorDatamap - the name equivalencies| 
 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||