KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > xquark > xquery > parser > ValidateExpression


1 /*
2  * This file belongs to the XQuark distribution.
3  * Copyright (C) 2003 Universite de Versailles Saint-Quentin.
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307.
18  * You can also get it at http://www.gnu.org/licenses/lgpl.html
19  *
20  * For more information on this software, see http://www.xquark.org.
21  */

22
23 /*
24  * ValidateExpression.java
25  *
26  * Created on 26 septembre 2002, 17:22
27  */

28
29 package org.xquark.xquery.parser;
30
31 import org.xquark.xquery.parser.util.Constants;
32 import org.xquark.xquery.typing.TypeException;
33
34
35 public class ValidateExpression extends XQueryUnaryOperatorExpression implements Cloneable JavaDoc {
36     
37     private static final String JavaDoc RCSRevision = "$Revision: 1.9 $";
38     private static final String JavaDoc RCSName = "$Name: $";
39     
40     protected int scopeType = Constants.NOTHING;
41     protected int validationType = Constants.NOTHING;
42     protected SchemaContextPath schemaContext = null;
43     
44     // #############################################################################
45
// VISITOR STUFF
46
// #############################################################################
47

48     public void accept(ParserVisitor visitor) throws XQueryException {
49         visitor.visit(this);
50     }
51     
52     // #############################################################################
53
// CONSTRUCTOR STUFF
54
// #############################################################################
55

56     public ValidateExpression(int scopeType, int validationType, SchemaContextPath schemaContext, XQueryExpression validateExpression, XQueryModule parentModule) throws TypeException, XQueryException {
57         super(validateExpression);
58         setScopeType(scopeType);
59         setValidationType(validationType);
60         setSchemaContext(schemaContext);
61         setParentModule(parentModule);
62         if (parentModule != null && parentModule.getStaticContext().getTypeVisitor() != null)
63             accept(parentModule.getStaticContext().getTypeVisitor());
64     }
65     
66     // #############################################################################
67
// ATTRIBUTE ACCESS STUFF
68
// #############################################################################
69

70     public void setParentModule(XQueryModule parentUnit) {
71         if (parentUnit == null) return;
72         this.parentModule = parentUnit;
73         super.setParentModule(parentUnit);
74         if (schemaContext != null) schemaContext.setParentModule(parentUnit);
75         expression.setParentModule(parentUnit);
76     }
77     
78     public void setSchemaContext(SchemaContextPath schemaContext) {
79         this.schemaContext = schemaContext;
80         if (schemaContext != null) {
81             this.schemaContext.setParentModule(parentModule);
82             this.schemaContext.setParentExpression(this);
83         }
84     }
85     
86     public SchemaContextPath getSchemaContext() { return schemaContext; }
87             
88     public void setScopeType(int scopeType) {
89         this.scopeType = scopeType;
90     }
91     
92     public int getScopeType() {
93         return scopeType;
94     }
95
96     public void setValidationType(int validationType) {
97         this.validationType = validationType;
98     }
99     
100     public int getValidationType() {
101         return validationType;
102     }
103     
104     
105 }
106
Popular Tags