summaryrefslogtreecommitdiffstats
blob: 601ab7d8f31924dbc56661e382793101e10fe343 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
* Copyright (c) 2014-2015, Isode Limited, London, England.
* All rights reserved.
*/
/*
 * Copyright (c) 2011 Vlad Voicu
 * Licensed under the Simplified BSD license.
 * See Documentation/Licenses/BSD-simplified.txt for more information.
 */

package com.isode.stroke.parser.payloadparsers;

import com.isode.stroke.elements.Replace;
import com.isode.stroke.parser.AttributeMap;
import com.isode.stroke.parser.GenericPayloadParser;

public class ReplaceParser extends GenericPayloadParser<Replace> {
    
    public ReplaceParser() {
        super(new Replace());
    }

    public void handleStartElement(String element, String ns, AttributeMap attributes) {
        if (level_ == 0) {
        	String id = attributes.getAttribute("id");
			getPayloadInternal().setID(id);
        }
        ++level_;
    }
    
    public void handleEndElement(String element, String ns) {
        --level_;
    }
    
    public void handleCharacterData(String data) {
    }

    private int level_;
}