View Javadoc

1   /*
2    * Copyright 2008-2013 smartics, Kronseder & Reiner GmbH
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 de.smartics.maven.issues.cache;
17  
18  import java.util.Map;
19  
20  import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
21  import org.eclipse.mylyn.tasks.core.data.TaskData;
22  
23  /**
24   * Interface to write a task.
25   *
26   * @author <a href="mailto:robert.reiner@smartics.de">Robert Reiner</a>
27   * @version $Revision:591 $
28   */
29  public interface TaskWriter
30  {
31    // ********************************* Fields *********************************
32  
33    // --- constants ------------------------------------------------------------
34  
35    // ****************************** Initializer *******************************
36  
37    // ****************************** Inner Classes *****************************
38  
39    // ********************************* Methods ********************************
40  
41    // --- get&set --------------------------------------------------------------
42  
43    // --- business -------------------------------------------------------------
44  
45    /**
46     * Writes the given task to the stream referenced by this instance.
47     *
48     * @param task the task to write.
49     * @throws Exception if the information cannot be written.
50     */
51    void writeTask(TaskData task) throws Exception;
52  
53    /**
54     * Writes the attribute.
55     *
56     * @param attribute the attribute to write.
57     * @throws Exception if the information cannot be written.
58     */
59    void writeAttribute(TaskAttribute attribute) throws Exception;
60  
61    /**
62     * Writes the set of attributes.
63     *
64     * @param attributes the attributes to write.
65     * @throws Exception if the information cannot be written.
66     */
67    void writeAttributes(Map<String, TaskAttribute> attributes) throws Exception;
68  
69    /**
70     * Writes the attribute values.
71     *
72     * @param attribute whose values are to be written.
73     * @throws Exception if the information cannot be written.
74     */
75    void writeAttributeValues(TaskAttribute attribute) throws Exception;
76  
77    /**
78     * Writes the key and values of the map. The key is the generic identifier
79     * (GI), the value the content of the XML element.
80     *
81     * @param gi the generic identifier of the element within the key-value pairs
82     *          are written.
83     * @param map the information to be written inside the element specified by
84     *          <code>gi</code>.
85     * @throws Exception if the information cannot be written.
86     */
87    void writeMap(String gi, Map<String, String> map) throws Exception;
88  
89    /**
90     * Writes a simple element containing no attributes and only text content.
91     *
92     * @param gi the generic identifier of the XML element to be written.
93     * @param content the content of the XML element to be written.
94     * @throws Exception if the information cannot be written.
95     */
96    void writeSimpleElement(String gi, String content) throws Exception;
97  
98    // --- object basics --------------------------------------------------------
99  
100 }