Statistics
| Revision:

root / trunk / libraries / libGPE / src / org / gvsig / xmlschema / som / IXSSchemaDocument.java @ 12175

History | View | Annotate | Download (5.25 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
import org.gvsig.xmlschema.exceptions.TypeNotFoundException;
8

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

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

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

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

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

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

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

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