bodhidharma.xml_parsing
Class XMLDocumentParser
java.lang.Object
bodhidharma.xml_parsing.XMLDocumentParser
public class XMLDocumentParser
- extends java.lang.Object
A holder class for the XMLDocumentParser
method.
This method is a general purpose method for loading an XML
file, testing that the file exists, validating it as a valid
XML file, ensuring that it is of the correct type, parsing
it and extracting its data into the required form. Informative
error exceptions are thrown in a format that can be displayed
directly to users.
Custom handlers can be written to properly extract
information from arbitrary XML files. The types of files
currently implemented are: project_file, taxonomy_file,
recordings_file, features_file, classifiers_file and
preferences_files. See the file handlers for each of these
file types for more information on the kind of data returned.
- See Also:
ParseFileHandler
,
ParsingXMLErrorHandler
,
ParseProjectFileHandler
,
ParseTaxonomyFileHandler
,
ParseRecordingsFileHandler
,
ParseFeaturesFileHandler
,
ParseClassifiersFileHandler
,
ParsePreferencesFileHandler
- Author:
- Cory McKay
Method Summary |
static java.lang.Object |
parseXMLDocument(java.lang.String file_path,
java.lang.String document_type)
This method is a general purpose method for loading an XML
file, testing that the file exists, validating it as a valid
XML file, ensuring that it is of the correct type, parsing
it and extracting its data into the required form. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XMLDocumentParser
public XMLDocumentParser()
parseXMLDocument
public static java.lang.Object parseXMLDocument(java.lang.String file_path,
java.lang.String document_type)
throws java.lang.Exception
- This method is a general purpose method for loading an XML
file, testing that the file exists, validating it as a valid
XML file, ensuring that it is of the correct type, parsing
it and extracting its data into the required form. Informative
error exceptions are thrown in a format that can be displayed
directly to users.
Custom handlers can be written to properly extract
information from arbitrary XML files. The types of files
currently implemented are: project_file, taxonomy_file,
recordings_file, features_file, classifiers_file and
preferences_files. See the file handlers for each of these
file types for more information on the kind of data returned.
- Parameters:
file_path
- The path of an XML file that will be parsed.document_type
- The type of XML file. Defined by the name of the first element in the file.
- Returns:
- An array of objects containing information extracted from the XML file. Object types depend on type of document parsed.
- Throws:
java.lang.Exception
- Informative exceptions are thrown if an invalid file path is specified.- See Also:
ParsingXMLErrorHandler
,
ParseProjectFileHandler
,
ParseTaxonomyFileHandler
,
ParseRecordingsFileHandler
,
ParseFeaturesFileHandler
,
ParseClassifiersFileHandler
,
ParsePreferencesFileHandler