Subversion Repositories HomeAutomation

Rev

Go to most recent revision | Blame | Last modification | View Log | SVN | RSS feed

  1. /*
  2.  * XMLDataHandler.java
  3.  *
  4.  * Created on den 27 augusti 2003, 18:05
  5.  */
  6. package Macbeth.XML;
  7.  
  8. import java.util.*;
  9.  
  10. /**
  11.  * Implement this interface if your class can take care of
  12.  * XML-data from an XML-parser.
  13.  * @author Jimmy
  14.  */
  15. public interface XMLDataHandler {
  16.     /**
  17.      * Called when start of a new element is found in the XML-data.
  18.      * Ex: <name attr1="value1" attr2="value2">
  19.      * Element name would then be "name" and attribute list
  20.      * would contain "value1" and "value2" mapped to the attribute
  21.      * names "attr1" and "attr2".
  22.      * @param element The name of the element.
  23.      * @param attributes The element attributes.
  24.      */
  25.     public void XMLstartElement(String element, HashMap attributes);
  26.  
  27.     /**
  28.      * Called when end of an element was found in the XML-data.
  29.      * Ex: </name> or <test attr="value" />
  30.      * @param element The name of the element.
  31.      */
  32.     public void XMLendElement(String element);
  33.  
  34.     /**
  35.      * Called when data was found between the start of a tag and
  36.      * the end of a tag.
  37.      * Ex: <test>Here is some text</test>
  38.      * The data would then be "Here is some text".
  39.      * @param data The data string.
  40.      */
  41.     public void XMLelementData(String data);
  42.  
  43.     /**
  44.      * Called when XML-parser starts parsing an XML document.
  45.      */
  46.     public void XMLdocumentStart();
  47.  
  48.     /**
  49.      * Called when XML-parser stops parsing an XML-document.
  50.      */
  51.     public void XMLdocumentEnd();
  52. }
  53.