Statistics
| Revision:

root / trunk / libraries / libGPE / src / org / gvsig / xmlschema / som / IXSSchema.java @ 12439

History | View | Annotate | Download (5.54 KB)

1
package org.gvsig.xmlschema.som;
2

    
3
import java.io.OutputStream;
4
import java.util.Collection;
5
import java.util.Enumeration;
6

    
7
import org.gvsig.xmlschema.exceptions.SchemaWrittingException;
8
import org.gvsig.xmlschema.utils.SchemaObjectsMapping;
9
import org.w3c.dom.Document;
10

    
11
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
12
 *
13
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
14
 *
15
 * This program is free software; you can redistribute it and/or
16
 * modify it under the terms of the GNU General Public License
17
 * as published by the Free Software Foundation; either version 2
18
 * of the License, or (at your option) any later version.
19
 *
20
 * This program is distributed in the hope that it will be useful,
21
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23
 * GNU General Public License for more details.
24
 *
25
 * You should have received a copy of the GNU General Public License
26
 * along with this program; if not, write to the Free Software
27
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
28
 *
29
 * For more information, contact:
30
 *
31
 *  Generalitat Valenciana
32
 *   Conselleria d'Infraestructures i Transport
33
 *   Av. Blasco Ib??ez, 50
34
 *   46010 VALENCIA
35
 *   SPAIN
36
 *
37
 *      +34 963862235
38
 *   gvsig@gva.es
39
 *      www.gvsig.gva.es
40
 *
41
 *    or
42
 *
43
 *   IVER T.I. S.A
44
 *   Salamanca 50
45
 *   46005 Valencia
46
 *   Spain
47
 *
48
 *   +34 963163400
49
 *   dac@iver.es
50
 */
51
/* CVS MESSAGES:
52
 *
53
 * $Id: IXSSchema.java 12439 2007-07-02 10:00:46Z jorpiell $
54
 * $Log$
55
 * Revision 1.3  2007-07-02 09:57:35  jorpiell
56
 * The generated xsd schemas have to be valid
57
 *
58
 * Revision 1.2  2007/06/22 12:20:48  jorpiell
59
 * The typeNotFoundException has been deleted. It never was thrown
60
 *
61
 * Revision 1.1  2007/06/14 16:15:03  jorpiell
62
 * builds to create the jars generated and add the schema code to the libGPEProject
63
 *
64
 * Revision 1.1  2007/06/14 13:50:07  jorpiell
65
 * The schema jar name has been changed
66
 *
67
 * Revision 1.6  2007/06/08 11:35:16  jorpiell
68
 * IXSSchema interface updated
69
 *
70
 * Revision 1.5  2007/06/07 14:54:13  jorpiell
71
 * Add the schema support
72
 *
73
 * Revision 1.4  2007/05/30 12:53:33  jorpiell
74
 * Not used libraries deleted
75
 *
76
 * Revision 1.3  2007/05/30 12:25:48  jorpiell
77
 * Add the element collection
78
 *
79
 * Revision 1.2  2007/05/28 12:38:03  jorpiell
80
 * Some bugs fixed
81
 *
82
 * Revision 1.1  2007/05/25 11:55:00  jorpiell
83
 * First update
84
 *
85
 *
86
 */
87
/**
88
 * This interface represents a XML schema. XML Schemas 
89
 * express shared vocabularies and allow machines to 
90
 * carry out rules made by people. They provide a means 
91
 * for defining the structure, content and semantics of 
92
 * XML documents. 
93
 * @see http://www.w3.org/XML/Schema
94
 * @author Jorge Piera LLodr? (jorge.piera@iver.es)
95
 */
96
public interface IXSSchema {
97
        
98
        /**
99
         * @return The schema target namespace.
100
         */
101
        public String getTargetNamespace();
102
        
103
        /**
104
         * @return The prefix for the target namespace.
105
         */
106
        public String getTargetNamespacePrefix();
107
        
108
        /**
109
         * It retusn a namespace prefix
110
         * @param namespaceURI
111
         * Namespace URI
112
         * @return
113
         * The namespace prefix
114
         */
115
        public String getNamespacePrefix(String namespaceURI);
116
        
117
        /**
118
         * @return the DOM document that contains the
119
         * schema information. It can be used by others 
120
         * applications to modify the schema
121
         */
122
        public Document getDocument();
123
        
124
        /**
125
         * @return the XML schema elements
126
         * @throws TypeNotFoundException
127
         */
128
        public Collection getElementDeclarations();
129
        
130
        /**
131
         * Search a XML schema element by name
132
         * @param targetNamespace
133
         * Namespace to seach the element
134
         * @param elementName
135
         * Element name
136
         * @return
137
         * A XML schema element
138
         * @throws TypeNotFoundException
139
         */
140
        public IXSElementDeclaration getElementDeclarationByName(String targetNamespace, String elementName);
141
        
142
        /**
143
         * @return the XML schema type definitions
144
         * @throws TypeNotFoundException
145
         */
146
        public Collection getTypeDefinitions();
147
        
148
        /**
149
         * Search a XML schema type definition by name
150
         * @param targetNamespace
151
         * Namespace to seach the element
152
         * @param typeName
153
         * XML schema type name
154
         * @return
155
         * A XML schema type definition
156
         * @throws TypeNotFoundException
157
         */
158
        public IXSTypeDefinition getTypeByName(String targetNamespace, String typeName);
159
        
160
        /**
161
         * It writes the schema to one OutputStream
162
         * @param os
163
         * OutputStream to write the file
164
         * @throws SchemaWrittingException
165
         */
166
        public void write(OutputStream os) throws SchemaWrittingException ;
167
                        
168
        /**
169
         * Add a new XML schema element
170
         * @param name
171
         * Element name
172
         * @param type
173
         * Element type
174
         * @param substitutionGroup
175
         * A top-level element definition.
176
         * @return
177
         * A XML schema element
178
         */
179
        public IXSElementDeclaration addElement(String name, String type, String substitutionGroup);
180
        
181
        /**
182
         * Add a new XML schema element
183
         * @param name
184
         * Element name
185
         * @param type
186
         * Element type
187
         * @return
188
         * A XML schema element
189
         */
190
        public IXSElementDeclaration addElement(String name, String type);
191
        
192
        /**
193
         * Add a new XML schema Complex type
194
         * @param name
195
         * Type name
196
         * @param type
197
         * See the IXSComplexType interface for possible values
198
         * @param contentType
199
         * A complex content or a simple content
200
         * See the IXSContentType for possible values
201
         * @param contentTypeRestriction
202
         * A extension or a restriction
203
         * @return
204
         * A xML schema complex type
205
         */
206
        public IXSComplexTypeDefinition addComplexType(String name, String type,
207
                        String contentType, String conteTypeRestriction);
208
        
209
        /**
210
         * @return
211
         * Return the mappings for all the schema objects that have
212
         * a class that represents them.
213
         */        
214
        public SchemaObjectsMapping getObjectsMapping();
215

    
216
        
217
}