|
1 /** |
|
2 * Copyright (c) 2012, Ben Fortuna |
|
3 * All rights reserved. |
|
4 * |
|
5 * Redistribution and use in source and binary forms, with or without |
|
6 * modification, are permitted provided that the following conditions |
|
7 * are met: |
|
8 * |
|
9 * o Redistributions of source code must retain the above copyright |
|
10 * notice, this list of conditions and the following disclaimer. |
|
11 * |
|
12 * o Redistributions in binary form must reproduce the above copyright |
|
13 * notice, this list of conditions and the following disclaimer in the |
|
14 * documentation and/or other materials provided with the distribution. |
|
15 * |
|
16 * o Neither the name of Ben Fortuna nor the names of any other contributors |
|
17 * may be used to endorse or promote products derived from this software |
|
18 * without specific prior written permission. |
|
19 * |
|
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
|
21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
|
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
|
23 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR |
|
24 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
|
25 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
|
26 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
|
27 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
|
28 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
|
29 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
|
30 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|
31 */ |
|
32 package net.fortuna.ical4j.data; |
|
33 |
|
34 import java.io.IOException; |
|
35 import java.net.URISyntaxException; |
|
36 import java.text.ParseException; |
|
37 |
|
38 /** |
|
39 * <pre> |
|
40 * $Id$ [Nov 5, |
|
41 * 2004] |
|
42 * </pre> |
|
43 * |
|
44 * Implementors provide functionality applicable during the parsing of an iCalendar data stream (e.g. building an object |
|
45 * model). |
|
46 * @author Ben Fortuna |
|
47 */ |
|
48 public interface ContentHandler { |
|
49 |
|
50 /** |
|
51 * Triggers the start of handling a calendar. |
|
52 */ |
|
53 void startCalendar(); |
|
54 |
|
55 /** |
|
56 * Triggers the end of handling a calendar. |
|
57 */ |
|
58 void endCalendar(); |
|
59 |
|
60 /** |
|
61 * Triggers the start of handling a component. |
|
62 * @param name a component name |
|
63 */ |
|
64 void startComponent(String name); |
|
65 |
|
66 /** |
|
67 * Triggers the end of handling a component. |
|
68 * @param name a component name |
|
69 */ |
|
70 void endComponent(String name); |
|
71 |
|
72 /** |
|
73 * Triggers the start of handling a property. |
|
74 * @param name a property name |
|
75 */ |
|
76 void startProperty(String name); |
|
77 |
|
78 /** |
|
79 * Triggers the handling of a property value. |
|
80 * @param value a property value |
|
81 * @throws URISyntaxException where the property value is not a valid URI for applicable properties |
|
82 * @throws ParseException where the date value cannot be parsed for applicable properties |
|
83 * @throws IOException where data cannot be read for applicable properties |
|
84 */ |
|
85 void propertyValue(String value) throws URISyntaxException, ParseException, |
|
86 IOException; |
|
87 |
|
88 /** |
|
89 * Triggers the end of handling a property. |
|
90 * @param name a property name |
|
91 */ |
|
92 void endProperty(String name); |
|
93 |
|
94 /** |
|
95 * Triggers the handling of a parameter. |
|
96 * @param name a parameter name |
|
97 * @param value a parameter value |
|
98 * @throws URISyntaxException where the parameter value is not a valid URI for applicable parameters |
|
99 */ |
|
100 void parameter(String name, String value) throws URISyntaxException; |
|
101 } |