jAudioFeatureExtractor.ACE.XMLParsers
クラス ParseTaxonomyFileHandler

java.lang.Object
  上位を拡張 org.xml.sax.helpers.DefaultHandler
      上位を拡張 jAudioFeatureExtractor.ACE.XMLParsers.ParseFileHandler
          上位を拡張 jAudioFeatureExtractor.ACE.XMLParsers.ParseTaxonomyFileHandler
すべての実装されたインタフェース:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public class ParseTaxonomyFileHandler
extends ParseFileHandler

An extension of the Xerces XML DefaultHandler class that implements the SAX ContentHandler. The methods of this class are called by an instance of an XMLReaderwhile it is parsing an XML document.

This particular implementation is custom designed to parse XML files of the taxonomy_file type used by the ACE classification system. A custom exception is thrown if the file is not of this type. At the end of parsing, the contents of the file elements are stored in the parsed_file_contents field as a one element array holding a DefaultTreeModel.

作成者:
Cory McKay

フィールドの概要
 
クラス jAudioFeatureExtractor.ACE.XMLParsers.ParseFileHandler から継承されたフィールド
comments, parsed_file_contents
 
コンストラクタの概要
ParseTaxonomyFileHandler()
           
 
メソッドの概要
 void characters(char[] ch, int start, int length)
          This method creates a new node of the tree and places the textual content of the element in the new node.
 void endDocument()
          This method is called when the end of the XML file being parsed is reached.
 void endElement(java.lang.String namespace, java.lang.String name, java.lang.String qName)
          This method is called when the end tag of an XML element is encountered.
 void startDocument()
          This method is called when the start of the XML file to be parsed is reached.
 void startElement(java.lang.String namespace, java.lang.String name, java.lang.String qName, org.xml.sax.Attributes atts)
          This method is called when the start of an XML element is encountered.
 
クラス org.xml.sax.helpers.DefaultHandler から継承されたメソッド
endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

ParseTaxonomyFileHandler

public ParseTaxonomyFileHandler()
メソッドの詳細

startDocument

public void startDocument()
This method is called when the start of the XML file to be parsed is reached. Initializes the fields.

定義:
インタフェース org.xml.sax.ContentHandler 内の startDocument
オーバーライド:
クラス org.xml.sax.helpers.DefaultHandler 内の startDocument

endDocument

public void endDocument()
This method is called when the end of the XML file being parsed is reached. Puts the parsed file contents into the parsed_file_contents array in the form of a DefaultTreeModel.

定義:
インタフェース org.xml.sax.ContentHandler 内の endDocument
オーバーライド:
クラス org.xml.sax.helpers.DefaultHandler 内の endDocument

startElement

public void startElement(java.lang.String namespace,
                         java.lang.String name,
                         java.lang.String qName,
                         org.xml.sax.Attributes atts)
                  throws org.xml.sax.SAXException
This method is called when the start of an XML element is encountered. Throws an exception if the XML document is the wrong type of XML document.

定義:
インタフェース org.xml.sax.ContentHandler 内の startElement
オーバーライド:
クラス org.xml.sax.helpers.DefaultHandler 内の startElement
パラメータ:
name - Name of the element that is encountered.
例外:
org.xml.sax.SAXException - Exception thrown if is wrong type of XML file.

endElement

public void endElement(java.lang.String namespace,
                       java.lang.String name,
                       java.lang.String qName)
This method is called when the end tag of an XML element is encountered. Moves the tree pointer to the root of the tree if this is the last element. Moves the tree pointer to the parent node of where it is currently pointing if this is not the end tag of a category_name element.

定義:
インタフェース org.xml.sax.ContentHandler 内の endElement
オーバーライド:
クラス org.xml.sax.helpers.DefaultHandler 内の endElement
パラメータ:
name - Name of the element that is encountered.

characters

public void characters(char[] ch,
                       int start,
                       int length)
This method creates a new node of the tree and places the textual content of the element in the new node. The tree pointer is then moved to this new child.

定義:
インタフェース org.xml.sax.ContentHandler 内の characters
オーバーライド:
クラス org.xml.sax.helpers.DefaultHandler 内の characters