KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > xquark > xquery > typing > QTypeItem


1 /*
2  * This file belongs to the XQuark distribution.
3  * Copyright (C) 2003 Universite de Versailles Saint-Quentin.
4  * Copyright (C) 2003 XQuark Group.
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 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 GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307.
19  * You can also get it at http://www.gnu.org/licenses/lgpl.html
20  *
21  * For more information on this software, see http://www.xquark.org.
22  */

23
24 package org.xquark.xquery.typing;
25
26 import org.xquark.schema.SimpleType;
27 import org.xquark.schema.Type;
28 import org.xquark.xquery.parser.XQueryException;
29
30 public abstract class QTypeItem extends QType {
31
32     /**
33      * schema type associated
34      */

35     Type type;
36
37     /**
38      *
39      */

40     public Type getType() {
41         return type;
42     }
43     /**
44      *
45      */

46     public SimpleType getSimpleType() {
47         if (type != null) return type.getValueType();
48         return null;
49     }
50     /**
51      *
52      */

53     protected void setType(Type type) {
54         this.type = type;
55     }
56
57     public void accept(QTypeVisitor visitor) throws XQueryException {
58         visitor.visit(this);
59     }
60
61 }
62
Popular Tags