Statistics
| Revision:

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

History | View | Annotate | Download (5.32 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.exceptions.TypeNotFoundException;
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 12175 2007-06-14 16:15:05Z jorpiell $
54
 * $Log$
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.6  2007/06/08 11:35:16  jorpiell
62
 * IXSSchema interface updated
63
 *
64
 * Revision 1.5  2007/06/07 14:54:13  jorpiell
65
 * Add the schema support
66
 *
67
 * Revision 1.4  2007/05/30 12:53:33  jorpiell
68
 * Not used libraries deleted
69
 *
70
 * Revision 1.3  2007/05/30 12:25:48  jorpiell
71
 * Add the element collection
72
 *
73
 * Revision 1.2  2007/05/28 12:38:03  jorpiell
74
 * Some bugs fixed
75
 *
76
 * Revision 1.1  2007/05/25 11:55:00  jorpiell
77
 * First update
78
 *
79
 *
80
 */
81
/**
82
 * This interface represents a XML schema. XML Schemas 
83
 * express shared vocabularies and allow machines to 
84
 * carry out rules made by people. They provide a means 
85
 * for defining the structure, content and semantics of 
86
 * XML documents. 
87
 * @see http://www.w3.org/XML/Schema
88
 * @author Jorge Piera LLodr? (jorge.piera@iver.es)
89
 */
90
public interface IXSSchema {
91
        
92
        /**
93
         * @return The schema target namespace.
94
         */
95
        public String getTargetNamespace();
96
        
97
        /**
98
         * @return the DOM document that contains the
99
         * schema information. It can be used by others 
100
         * applications to modify the schema
101
         */
102
        public Document getDocument();
103
        
104
        /**
105
         * @return the XML schema elements
106
         * @throws TypeNotFoundException
107
         */
108
        public Collection getElementDeclarations() throws TypeNotFoundException;
109
        
110
        /**
111
         * Search a XML schema element by name
112
         * @param targetNamespace
113
         * Namespace to seach the element
114
         * @param elementName
115
         * Element name
116
         * @return
117
         * A XML schema element
118
         * @throws TypeNotFoundException
119
         */
120
        public IXSElementDeclaration getElementDeclarationByName(String targetNamespace, String elementName) throws TypeNotFoundException;
121
        
122
        /**
123
         * @return the XML schema type definitions
124
         * @throws TypeNotFoundException
125
         */
126
        public Collection getTypeDefinitions() throws TypeNotFoundException;
127
        
128
        /**
129
         * Search a XML schema type definition by name
130
         * @param targetNamespace
131
         * Namespace to seach the element
132
         * @param typeName
133
         * XML schema type name
134
         * @return
135
         * A XML schema type definition
136
         * @throws TypeNotFoundException
137
         */
138
        public IXSTypeDefinition getTypeByName(String targetNamespace, String typeName) throws TypeNotFoundException;
139
        
140
        /**
141
         * It writes the schema to one OutputStream
142
         * @param os
143
         * OutputStream to write the file
144
         * @throws SchemaWrittingException
145
         */
146
        public void write(OutputStream os) throws SchemaWrittingException ;
147
                
148
        /**
149
         * Add a new XML schema element
150
         * @param name
151
         * Element name
152
         * @param type
153
         * Element type
154
         * @param nillable
155
         * If the element can be nillable
156
         * @param minOccurs
157
         * The minimum number of elements
158
         * @param maxOccurs
159
         * Teh maximum number of elements
160
         * @return
161
         * A XML schema element
162
         */
163
        public IXSElementDeclaration addElement(String name, String type, boolean nillable, int minOccurs, int maxOccurs);
164
        
165
        /**
166
         * Add a new XML schema element
167
         * @param name
168
         * Element name
169
         * @param type
170
         * Element type
171
         * @return
172
         * A XML schema element
173
         */
174
        public IXSElementDeclaration addElement(String name, String type);
175
        
176
        /**
177
         * Add a new XML schema Complex type
178
         * @param name
179
         * Type name
180
         * @param type
181
         * See the IXSComplexType interface for possible values
182
         * @param contentType
183
         * A complex content or a simple content
184
         * See the IXSContentType for possible values
185
         * @param contentTypeRestriction
186
         * A extension or a restriction
187
         * @return
188
         * A xML schema complex type
189
         */
190
        public IXSComplexTypeDefinition addComplexType(String name, String type,
191
                        String contentType, String conteTypeRestriction);
192
        
193
        /**
194
         * @return
195
         * Return the mappings for all the schema objects that have
196
         * a class that represents them.
197
         */        
198
        public SchemaObjectsMapping getObjectsMapping();
199

    
200
        
201
}