jAudioFeatureExtractor.ACE.XMLParsers
クラス ParseFeatureDefinitionsFileHandler

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

public class ParseFeatureDefinitionsFileHandler
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 XMLReader while it is parsing an XML document.

This particular implementation is custom designed to parse XML files of the feature_key_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 files elements are stored in the parsed_file_contents field.

作成者:
Cory McKay

フィールドの概要
 
クラス jAudioFeatureExtractor.ACE.XMLParsers.ParseFileHandler から継承されたフィールド
comments, parsed_file_contents
 
コンストラクタの概要
ParseFeatureDefinitionsFileHandler()
           
 
メソッドの概要
 void characters(char[] ch, int start, int length)
          This method responds to the contents of tags in a way determined by the name of the tag (as determined by the startElement method).
 void endDocument()
          This method is called when the end tag of an XML element is encountered.
 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
 

コンストラクタの詳細

ParseFeatureDefinitionsFileHandler

public ParseFeatureDefinitionsFileHandler()
メソッドの詳細

startDocument

public void startDocument()
This method is called when the start of the XML file to be parsed is reached. Instantiates the definitions field and sets the count to 0.

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

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. Instantiates a new FeatureDefinition object if a feature tag was encountered. Otherwise lets the characters method know what kind of action to take.

定義:
インタフェース 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.

characters

public void characters(char[] ch,
                       int start,
                       int length)
This method responds to the contents of tags in a way determined by the name of the tag (as determined by the startElement method).

The FeatureDefinition object represented by current_definition is filled by the contents of the name, description, is_sequential and parallel_dimensions tags.

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

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. Adds the current_definition to the definitions list when the feature end tag is encountered.

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

endDocument

public void endDocument()
This method is called when the end tag of an XML element is encountered. Fills the parsed_file_contents field with the definitions LinkedList.

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