Subversion Repositories HomeAutomation

Rev

Rev 15 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

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