Statistics
| Revision:

root / org.gvsig.xmlschema / library / trunk / org.gvsig.xmlschema / org.gvsig.xmlschema.prov / org.gvsig.xmlschema.prov.kxml / src / main / java / org / gvsig / xmlschema / prov / kxml / model / XSRestriction.java @ 250

History | View | Annotate | Download (2.83 KB)

1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 */
22
package org.gvsig.xmlschema.prov.kxml.model;
23

    
24
import java.io.IOException;
25

    
26
import org.gvsig.xmlpull.lib.api.stream.IXmlStreamReader;
27
import org.gvsig.xmlschema.lib.api.som.IXSGroup;
28
import org.gvsig.xmlschema.lib.api.som.IXSRestriction;
29
import org.gvsig.xmlschema.lib.api.utils.SchemaTags;
30

    
31

    
32
/**
33
 * @author gvSIG Team
34
 * @version $Id$
35
 *
36
 */
37
public class XSRestriction extends AbstractXSComponent implements IXSRestriction{
38
    private IXSGroup group = null;
39
    
40
    public XSRestriction(XSSchema schema, IXmlStreamReader xmlStreamReader) throws IOException {
41
        super(schema);
42
        parse(xmlStreamReader);
43
    }
44
    
45
    //Comprueba que las etiquetas extension se abren y se cierran
46
    private void parse(IXmlStreamReader xmlStreamReader) throws IOException
47
    {   
48
        int currentTag;
49
        boolean end = false;
50

    
51

    
52
        //require(KXmlParser.START_TAG, null, SchemaTags.RESTRICTION);
53
        currentTag = xmlStreamReader.next();
54

    
55
        while (!end) 
56
        {
57
            switch(currentTag)
58
            {
59
            case IXmlStreamReader.START_ELEMENT:
60
                if (SchemaTags.SEQUENCE.equals(xmlStreamReader.getName().getLocalPart())){
61
                    group = new XSSequence(schema, xmlStreamReader); 
62
                }   
63
                break;
64
            case IXmlStreamReader.END_ELEMENT:
65
                if (SchemaTags.RESTRICTION.equals(xmlStreamReader.getName().getLocalPart())){
66
                    end = true;
67
                }
68
                break;
69
            case IXmlStreamReader.CHARACTERS:                   
70
                break;
71
            }
72
            if (!end){
73
                currentTag = xmlStreamReader.next();
74
            }           
75
        }
76
    }
77

    
78
    public short getNodeType() {
79
        // TODO Auto-generated method stub
80
        return 0;
81
    }
82

    
83
    public String getNodeValue() {
84
        // TODO Auto-generated method stub
85
        return null;
86
    }
87

    
88
    public IXSGroup getGroup() {
89
       return group;
90
    }
91

    
92

    
93
}