Statistics
| Revision:

svn-gvsig-desktop / trunk / libraries / libGPE / src / org / gvsig / xmlschema / som / impl / XSComponentImpl.java @ 18770

History | View | Annotate | Download (2.98 KB)

1
package org.gvsig.xmlschema.som.impl;
2

    
3
import java.util.Collection;
4

    
5
import org.gvsig.xmlschema.utils.QName;
6

    
7
import org.gvsig.xmlschema.som.IXSComponent;
8
import org.gvsig.xmlschema.som.IXSSchema;
9
import org.gvsig.xmlschema.utils.SchemaCollection;
10
import org.gvsig.xmlschema.utils.SchemaTags;
11

    
12
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
13
 *
14
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
15
 *
16
 * This program is free software; you can redistribute it and/or
17
 * modify it under the terms of the GNU General Public License
18
 * as published by the Free Software Foundation; either version 2
19
 * of the License, or (at your option) any later version.
20
 *
21
 * This program is distributed in the hope that it will be useful,
22
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24
 * GNU General Public License for more details.
25
 *
26
 * You should have received a copy of the GNU General Public License
27
 * along with this program; if not, write to the Free Software
28
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
29
 *
30
 * For more information, contact:
31
 *
32
 *  Generalitat Valenciana
33
 *   Conselleria d'Infraestructures i Transport
34
 *   Av. Blasco Ib??ez, 50
35
 *   46010 VALENCIA
36
 *   SPAIN
37
 *
38
 *      +34 963862235
39
 *   gvsig@gva.es
40
 *      www.gvsig.gva.es
41
 *
42
 *    or
43
 *
44
 *   IVER T.I. S.A
45
 *   Salamanca 50
46
 *   46005 Valencia
47
 *   Spain
48
 *
49
 *   +34 963163400
50
 *   dac@iver.es
51
 */
52
/* CVS MESSAGES:
53
 *
54
 * $Id: XSComponentImpl.java 161 2007-06-28 13:05:27Z jorpiell $
55
 * $Log$
56
 * Revision 1.3  2007/06/28 13:04:33  jorpiell
57
 * The Qname has been updated to the 1.5 JVM machine. The schema validation is made in the GPEWriterHandlerImplementor class
58
 *
59
 * Revision 1.2  2007/06/22 12:20:48  jorpiell
60
 * The typeNotFoundException has been deleted. It never was thrown
61
 *
62
 * Revision 1.1  2007/06/14 16:15:03  jorpiell
63
 * builds to create the jars generated and add the schema code to the libGPEProject
64
 *
65
 * Revision 1.1  2007/06/14 13:50:07  jorpiell
66
 * The schema jar name has been changed
67
 *
68
 * Revision 1.4  2007/06/08 06:55:05  jorpiell
69
 * Fixed some bugs
70
 *
71
 * Revision 1.3  2007/06/07 14:54:13  jorpiell
72
 * Add the schema support
73
 *
74
 * Revision 1.2  2007/05/30 12:25:48  jorpiell
75
 * Add the element collection
76
 *
77
 * Revision 1.1  2007/05/25 11:55:00  jorpiell
78
 * First update
79
 *
80
 *
81
 */
82
/**
83
 * @author Jorge Piera LLodr? (jorge.piera@iver.es)
84
 */
85
public abstract class XSComponentImpl extends XSNodeImpl implements IXSComponent{
86
        private IXSSchema schema = null;
87
        
88
        public XSComponentImpl(IXSSchema schema) {
89
                super();
90
                this.schema = schema;                
91
        }
92

    
93
        public QName getQName() {
94
                return new QName(schema.getTargetNamespace(), getElement().getAttribute(SchemaTags.NAME));
95
        }
96

    
97
        public IXSSchema getSchema() {
98
                return schema;
99
        }        
100
        
101
        /**
102
         * Get all the subeleemnts of a XML node
103
         * @return
104
         * @throws TypeNotFoundException
105
         */
106
        public Collection getItems(){
107
                return new SchemaCollection(getSchema(),getElement());
108
        }
109
}