Statistics
| Revision:

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

History | View | Annotate | Download (2.73 KB)

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

    
3
import java.util.Collection;
4

    
5
import org.apache.xml.utils.QName;
6
import org.gvsig.xmlschema.exceptions.TypeNotFoundException;
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 12175 2007-06-14 16:15:05Z jorpiell $
55
 * $Log$
56
 * Revision 1.1  2007-06-14 16:15:03  jorpiell
57
 * builds to create the jars generated and add the schema code to the libGPEProject
58
 *
59
 * Revision 1.1  2007/06/14 13:50:07  jorpiell
60
 * The schema jar name has been changed
61
 *
62
 * Revision 1.4  2007/06/08 06:55:05  jorpiell
63
 * Fixed some bugs
64
 *
65
 * Revision 1.3  2007/06/07 14:54:13  jorpiell
66
 * Add the schema support
67
 *
68
 * Revision 1.2  2007/05/30 12:25:48  jorpiell
69
 * Add the element collection
70
 *
71
 * Revision 1.1  2007/05/25 11:55:00  jorpiell
72
 * First update
73
 *
74
 *
75
 */
76
/**
77
 * @author Jorge Piera LLodr? (jorge.piera@iver.es)
78
 */
79
public abstract class XSComponentImpl extends XSNodeImpl implements IXSComponent{
80
        private IXSSchema schema = null;
81
        
82
        public XSComponentImpl(IXSSchema schema) {
83
                super();
84
                this.schema = schema;                
85
        }
86

    
87
        public QName getQName() {
88
                return new QName(schema.getTargetNamespace(), getElement().getAttribute(SchemaTags.NAME));
89
        }
90

    
91
        public IXSSchema getSchema() {
92
                return schema;
93
        }        
94
        
95
        /**
96
         * Get all the subeleemnts of a XML node
97
         * @return
98
         * @throws TypeNotFoundException
99
         */
100
        public Collection getItems() throws TypeNotFoundException {
101
                return new SchemaCollection(getSchema(),getElement());
102
        }
103
}