1 22 23 package org.xquark.xquery.parser; 24 25 import org.xquark.xquery.typing.TypeException; 26 27 28 public class InstanceOfExpression extends XQueryUnaryOperatorExpression implements Cloneable { 29 30 private static final String RCSRevision = "$Revision: 1.11 $"; 31 private static final String RCSName = "$Name: $"; 32 33 protected SequenceType sequenceType = null; 37 38 42 public void accept(ParserVisitor visitor) throws XQueryException { 43 visitor.visit(this); 44 } 45 46 50 public InstanceOfExpression(XQueryExpression expression, SequenceType sequenceType, XQueryModule parentModule) throws TypeException, XQueryException { 51 super(expression); 52 setSequenceType(sequenceType); 53 setParentModule(parentModule); 54 if (parentModule != null && parentModule.getStaticContext().getTypeVisitor() != null) 55 accept(parentModule.getStaticContext().getTypeVisitor()); 56 } 57 58 62 public SequenceType getSequenceType() { 63 return sequenceType; 64 } 65 public void setSequenceType(SequenceType sequenceType) throws XQueryException { 66 if (sequenceType == null) 68 throw new XQueryException("sequenceType of InstanceOfExpression cannot be null"); 69 this.sequenceType = sequenceType; 70 this.sequenceType.setParentModule(parentModule); 71 this.sequenceType.setParentExpression(this); 72 } 73 74 public void addParentExpression(XQueryExpression parentExpression) { 78 addParentExpression(parentExpression); 79 sequenceType.addParentExpression(parentExpression); 80 if (expression != null) 81 expression.addParentExpression(parentExpression); 82 } 83 84 } 85 | Popular Tags |