KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > sync4j > syncclient > blackberry > parser > ParserFactory


1 /**
2  * Copyright (C) 2003-2005 Funambol
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  */

18
19 package sync4j.syncclient.blackberry.parser;
20
21 import javax.microedition.pim.Contact;
22 import javax.microedition.pim.ContactList;
23 import javax.microedition.pim.Event;
24 import javax.microedition.pim.EventList;
25
26 /**
27  * <code>ParserFactory</code> used for obtaining an instance of ContactParser.
28  *
29  * @author santoshs email:info@telibrahma.com
30  * @author Fabio Maggi @ Funambol
31  * $Id: ParserFactory.java,v 1.0
32  */

33
34 public class ParserFactory
35 {
36    /**
37     * This method is invoked to obtain an instance of XMLContactParser.
38     * the XMLContactParser implements ContactParser interface.
39     *
40     * @param ContactList: Blackberry contact list
41     * @param Contact: Blackberry contact
42     * @param boolean: to modify or not to modify
43     * @return XMLContactParser
44     */

45    public static final ContactParser getParserInstance(ContactList list, Contact contact, boolean shouldModify) {
46        return new XMLContactParser(list, contact, shouldModify);
47    }
48    
49    /**
50     * This method is invoked to obtain an instance of XMLEventParser.
51     * the XMLEventParser implements EventParser interface.
52     *
53     * @param EventList: Blackberry event list
54     * @param Event: Blackberry event
55     * @param boolean: to modify or not to modify
56     * @return XMLEventParser
57     */

58    public static final EventParser getParserInstance(EventList list, Event event, boolean shouldModify) {
59        return new XMLEventParser(list, event, shouldModify);
60    }
61    
62 }
63
Popular Tags