1 22 23 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 { 36 37 private static final String RCSRevision = "$Revision: 1.9 $"; 38 private static final String RCSName = "$Name: $"; 39 40 protected int scopeType = Constants.NOTHING; 41 protected int validationType = Constants.NOTHING; 42 protected SchemaContextPath schemaContext = null; 43 44 48 public void accept(ParserVisitor visitor) throws XQueryException { 49 visitor.visit(this); 50 } 51 52 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 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 |