PropertyFactory.kt 855 Bytes
Newer Older
1 2 3 4 5 6 7 8
/*
 * Copyright © Ricki Hirner (bitfire web engineering).
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Public License v3.0
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/gpl.html
 */

9
package at.bitfire.dav4android
Ricki Hirner's avatar
Ricki Hirner committed
10 11

import org.xmlpull.v1.XmlPullParser
12 13
import org.xmlpull.v1.XmlPullParserException
import java.io.IOException
Ricki Hirner's avatar
Ricki Hirner committed
14 15 16 17 18 19 20 21 22

interface PropertyFactory {

    /**
     * Name of the Property the factory creates,
     * e.g. Property.Name("DAV:", "displayname") if the factory creates DisplayName objects)
     */
    fun getName(): Property.Name

23 24 25 26
    /**
     * Parses XML of a property and returns its data class.
     * @throws XmlPullParserException in case of parsing errors
     */
Ricki Hirner's avatar
Ricki Hirner committed
27 28 29
    fun create(parser: XmlPullParser): Property?

}