|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object viper.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 DescriptorConfigs associated 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()
DescriptorData
DescriptorConfigs
associated with this data.
getDescriptorConfigs
in interface DescriptorData
DescriptorConfigs
associated with this datapublic void setDescriptorConfigs(DescriptorConfigs cfgs)
cfgs
- the new schemapublic boolean isMultifile()
DescriptorData
isMultifile
in interface DescriptorData
true
if this describes more than one media filepublic void parseData(java.util.List allFiles, DescriptorConfigs cfgs, RuleHolder limits, Equivalencies map)
parseData
in interface DescriptorData
allFiles
- list of file names/paths (String objects)cfgs
- the configurationlimits
- the rules to use while parsingmap
- the equivalency listpublic 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 DescriptorData
public DescriptorList getForFile(java.lang.String filename)
DescriptorData
getForFile
in interface DescriptorData
filename
- the file to get the metadata of
public java.util.Iterator getFileNames()
DescriptorData
getFileNames
in interface DescriptorData
public boolean addFileName(java.lang.String S)
DescriptorData
addFileName
in interface DescriptorData
S
- the name of the file to add
public DescriptorList setDataForFile(java.lang.String S, DescriptorList l)
DescriptorData
setDataForFile
in interface DescriptorData
S
- the name of the file to changel
- the new value
public DescriptorList removeFile(java.lang.String filename)
DescriptorData
removeFile
in interface DescriptorData
filename
- the file to remove
public java.lang.String getInformation()
DescriptorData
Directory 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 DescriptorData
input
- 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
, 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
- the error writerfilename
- the name of the file; useful for error writing
java.io.IOException
BadDataException
public org.w3c.dom.Element getXMLFormat(org.w3c.dom.Document root)
DescriptorData
getXMLFormat
in interface DescriptorData
root
- the document to use while creating the element
public void merge(DescriptorData other) throws java.lang.IllegalArgumentException
DescriptorData
merge
in interface DescriptorData
other
- the data to merge from
java.lang.IllegalArgumentException
public void resetIds()
DescriptorData
resetIds
in interface DescriptorData
public Equivalencies getMap()
getMap
in interface DescriptorData
public void setMap(Equivalencies map)
setMap
in interface DescriptorData
map
- the name equivalencies
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |