KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > emf > ecore > xmi > XMLSave


1 /**
2  * <copyright>
3  *
4  * Copyright (c) 2002-2004 IBM Corporation and others.
5  * All rights reserved. This program and the accompanying materials
6  * are made available under the terms of the Eclipse Public License v1.0
7  * which accompanies this distribution, and is available at
8  * http://www.eclipse.org/legal/epl-v10.html
9  *
10  * Contributors:
11  * IBM - Initial API and implementation
12  *
13  * </copyright>
14  *
15  * $Id: XMLSave.java,v 1.6 2005/06/15 21:16:49 elena Exp $
16  */

17 package org.eclipse.emf.ecore.xmi;
18
19 import java.io.IOException JavaDoc;
20 import java.io.OutputStream JavaDoc;
21 import java.util.Map JavaDoc;
22
23 import org.eclipse.emf.ecore.EClass;
24 import org.eclipse.emf.ecore.EClassifier;
25 import org.eclipse.emf.ecore.EStructuralFeature;
26 import org.w3c.dom.Document JavaDoc;
27
28
29 /**
30  * This defines the methods for the interface that XMLResourceImpl
31  * uses to save the resource.
32  */

33 public interface XMLSave
34 {
35
36   /**
37    * This defines the methods for the interface used to determine
38    * whether type information should be saved when the
39    * XMLResource.OPTION_SAVE_TYPE_INFORMATION save option is enabled.
40    */

41   interface XMLTypeInfo
42   {
43
44     /**
45      * Determines whether type information should be saved for an object of the
46      * specified type in a feature of the specified type.
47      *
48      * @param objectType The object's type.
49      * @param featureType The feature's type.
50      * @param feature The feature in which the object is stored.
51      * @return <code>true</code> if the type should be saved; <code>false</code>
52      * otherwise.
53      */

54     boolean shouldSaveType(EClass objectType, EClassifier featureType, EStructuralFeature feature);
55
56     /**
57      * Determines whether type information should be saved for an object of the
58      * specified type in a feature of the specified type.
59      *
60      * @param objectType The object's type.
61      * @param featureType The feature's type.
62      * @param feature The feature in which the object is stored.
63      * @return <code>true</code> if the type should be saved; <code>false</code>
64      * otherwise.
65      */

66     boolean shouldSaveType(EClass objectType, EClass featureType, EStructuralFeature feature);
67
68   }
69
70   void save(XMLResource resource, OutputStream JavaDoc outputStream, Map JavaDoc options) throws IOException JavaDoc;
71
72   /**
73    * @param resource a resource
74    * @param document a {@link org.w3c.dom.Document} (must not be null)
75    * @param options options
76    * @param handler a {@link DOMHandler} (must not be null)
77    * @return the document
78    * @since 2.1.0
79    */

80   Document JavaDoc save(XMLResource resource, Document JavaDoc document, Map JavaDoc options, DOMHandler handler);
81 }
82
Popular Tags