1 /*
2  * Copyright (C) 2009 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package com.android.vcard;
17 
18 /**
19  * <p>
20  * The interface called by {@link VCardEntryConstructor}.
21  * </p>
22  * <p>
23  * This class is useful when you don't want to know vCard data in detail. If you want to know
24  * it, it would be better to consider using {@link VCardInterpreter}.
25  * </p>
26  */
27 public interface VCardEntryHandler {
28     /**
29      * Called when the parsing started.
30      */
onStart()31     public void onStart();
32 
33     /**
34      * The method called when one vCard entry is created. Children come before their parent in
35      * nested vCard files.
36      *
37      * e.g.
38      * In the following vCard, the entry for "entry2" comes before one for "entry1".
39      * <code>
40      * BEGIN:VCARD
41      * N:entry1
42      * BEGIN:VCARD
43      * N:entry2
44      * END:VCARD
45      * END:VCARD
46      * </code>
47      */
onEntryCreated(final VCardEntry entry)48     public void onEntryCreated(final VCardEntry entry);
49 
50     /**
51      * Called when the parsing ended.
52      * Able to be use this method for showing performance log, etc.
53      */
onEnd()54     public void onEnd();
55 }
56