Statistics
| Revision:

svn-gvsig-desktop / trunk / libraries / libGPE / src / org / gvsig / xmlschema / som / IXSSchemaDocument.java @ 12311

History | View | Annotate | Download (5.43 KB)

1
package org.gvsig.xmlschema.som;
2

    
3
import java.net.URI;
4
import java.util.Enumeration;
5

    
6
import org.gvsig.xmlschema.exceptions.SchemaCreationException;
7

    
8
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
9
 *
10
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
11
 *
12
 * This program is free software; you can redistribute it and/or
13
 * modify it under the terms of the GNU General Public License
14
 * as published by the Free Software Foundation; either version 2
15
 * of the License, or (at your option) any later version.
16
 *
17
 * This program is distributed in the hope that it will be useful,
18
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
 * GNU General Public License for more details.
21
 *
22
 * You should have received a copy of the GNU General Public License
23
 * along with this program; if not, write to the Free Software
24
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
25
 *
26
 * For more information, contact:
27
 *
28
 *  Generalitat Valenciana
29
 *   Conselleria d'Infraestructures i Transport
30
 *   Av. Blasco Ib??ez, 50
31
 *   46010 VALENCIA
32
 *   SPAIN
33
 *
34
 *      +34 963862235
35
 *   gvsig@gva.es
36
 *      www.gvsig.gva.es
37
 *
38
 *    or
39
 *
40
 *   IVER T.I. S.A
41
 *   Salamanca 50
42
 *   46005 Valencia
43
 *   Spain
44
 *
45
 *   +34 963163400
46
 *   dac@iver.es
47
 */
48
/* CVS MESSAGES:
49
 *
50
 * $Id: IXSSchemaDocument.java 12311 2007-06-22 12:22:53Z jorpiell $
51
 * $Log$
52
 * Revision 1.2  2007-06-22 12:20:48  jorpiell
53
 * The typeNotFoundException has been deleted. It never was thrown
54
 *
55
 * Revision 1.1  2007/06/14 16:15:03  jorpiell
56
 * builds to create the jars generated and add the schema code to the libGPEProject
57
 *
58
 * Revision 1.1  2007/06/14 13:50:07  jorpiell
59
 * The schema jar name has been changed
60
 *
61
 * Revision 1.2  2007/06/08 13:00:40  jorpiell
62
 * Add the targetNamespace to the file
63
 *
64
 * Revision 1.1  2007/06/07 14:54:13  jorpiell
65
 * Add the schema support
66
 *
67
 *
68
 */
69
/**
70
 * This interface represents a XML file. It could has some
71
 * associated schemas.
72
 * @author Jorge Piera LLodr? (jorge.piera@iver.es)
73
 */
74
public interface IXSSchemaDocument {
75
        
76
        /**
77
         * @return <true> if the document has a schema
78
         */
79
        public boolean hasSchemas();
80
        
81
        /**
82
         * @return <true> if the document has namespace prefixes
83
         */
84
        public boolean hasPrefixes();
85
        
86
        /**
87
         * Adds a new Schema from a URI. It downloads the file
88
         * and creates the schema
89
         * @param uri
90
         * URI tha contains the schema
91
         * @param schema
92
         * Schema to add
93
         */
94
        public void addSchema(URI uri) throws SchemaCreationException;        
95
        
96
        /**
97
         * Adds a new Schema from a URI
98
         * @param uri
99
         * URI tha contains the schema
100
         * @param schema
101
         * Schema to add
102
         */
103
        public void addSchema(URI uri, IXSSchema schema);
104
        
105
        /**
106
         * Add a schema location.
107
         * @param uri
108
         * @param schemaLocation
109
         */
110
        public void addSchemaLocation(URI uri, String schemaLocation);
111
        
112
        /**
113
         * Gets the schema location
114
         * @param uri
115
         * Schema URI
116
         * @return
117
         * The schema location
118
         */
119
        public String getSchemaLocation(URI uri);
120
        
121
        /**
122
         * Return <true> if the schema URI has a schema location
123
         * @param uri
124
         * @return
125
         */
126
        public boolean hasSchemaLocation(URI uri);
127

    
128
        /**
129
         * Return if the map has a schema
130
         * @param uri
131
         * URI tha contains the schema
132
         * @return
133
         * <true> if exists or <false>
134
         */
135
        public boolean hasSchema(URI uri);
136

    
137
        /**
138
         * @return
139
         * A lsit of the schemas URI's
140
         */
141
        public Enumeration getURIs();
142

    
143
        /**
144
         * @return
145
         * A list of schemas
146
         */
147
        public Enumeration getSchemas();
148

    
149
        /**
150
         * @return
151
         * A list of namespace prefixes
152
         */
153
        public Enumeration getPrefixes();
154
        
155
        /**
156
         * Get a schema from a URI
157
         * @param uri
158
         * URI where the schema is
159
         * @return
160
         * A Schema
161
         */
162
        public IXSSchema getSchema(URI uri);
163

    
164
        /**
165
         * Remove a schema from a URI
166
         * @param uri
167
         * Schema URI
168
         */
169
        public void remove(URI uri);
170

    
171
        /**
172
         * Adds a prefix from a namespace that is used into the
173
         * XML file
174
         * @param prefix
175
         * Napescape prefix
176
         * @param namespaceURI
177
         * Napespace URI
178
         */
179
        public void addNamespacePrefix(String prefix, String namespaceURI);
180

    
181
        /**
182
         * Return the namespace URI from a prefix
183
         * @param prefix
184
         * Namespace prefix
185
         * @return
186
         * A namespace URI
187
         */
188
        public String getNamespaceURI(String prefix);
189
        
190
        /**
191
         * It retusn the namespace prefix
192
         * @param namespaceURI
193
         * Namespace URI
194
         * @return
195
         * The namespace prefix
196
         */
197
        public String getNamespacePrefix(String namespaceURI);
198
        
199
        /**
200
         * Get a element from a qualified name
201
         * @param namespacePrefix
202
         * Namespace prefix
203
         * @param elementName
204
         * Local name
205
         * @return
206
         * A SXD element
207
         * @throws TypeNotFoundException 
208
         */
209
        public IXSElementDeclaration getElementDeclarationByName(String namespacePrefix, String elementName) ;
210
        
211
        /**
212
         * Get a element from a qualified name
213
         * @param elementName
214
         * Namespace prefix and local name
215
         * @return
216
         * A SXD element
217
         * @throws TypeNotFoundException 
218
         */
219
        public IXSElementDeclaration getElementDeclarationByName(String elementName);
220
                
221
        /**
222
         * @return <true> if the element names are qualified
223
         */
224
        public boolean isElementFormDefault();
225
        
226
        /**
227
         * Set if the element names are qualified
228
         * @param isElementQualified
229
         * <true> if the element names are qualified
230
         */
231
        public void setElementFormDefault(boolean isQualified);
232
        
233
        /**
234
         * @return the targetNamespace for the file. It will be used
235
         * for the unqualified names
236
         */
237
        public String getTargetNamespace();
238
        
239
        /**
240
         * Set the targetNamespace
241
         * @param targetNamespace
242
         * TargetNamespace to set
243
         */
244
        public void setTargetNamespace(String targetNamespace);
245
}