Statistics
| Revision:

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

History | View | Annotate | Download (5.26 KB)

1
package org.gvsig.xmlschema.som;
2

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

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

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

    
202
        
203
}