1 16 19 package com.sun.org.apache.xpath.internal.operations; 20 21 import com.sun.org.apache.xpath.internal.Expression; 22 import com.sun.org.apache.xpath.internal.ExpressionOwner; 23 import com.sun.org.apache.xpath.internal.XPathContext; 24 import com.sun.org.apache.xpath.internal.XPathVisitor; 25 import com.sun.org.apache.xpath.internal.objects.XObject; 26 27 30 public abstract class UnaryOperation extends Expression implements ExpressionOwner 31 { 32 33 35 protected Expression m_right; 36 37 47 public void fixupVariables(java.util.Vector vars, int globalsSize) 48 { 49 m_right.fixupVariables(vars, globalsSize); 50 } 51 52 58 public boolean canTraverseOutsideSubtree() 59 { 60 61 if (null != m_right && m_right.canTraverseOutsideSubtree()) 62 return true; 63 64 return false; 65 } 66 67 74 public void setRight(Expression r) 75 { 76 m_right = r; 77 r.exprSetParent(this); 78 } 79 80 91 public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException 92 { 93 94 return operate(m_right.execute(xctxt)); 95 } 96 97 107 public abstract XObject operate(XObject right) 108 throws javax.xml.transform.TransformerException ; 109 110 112 public Expression getOperand(){ 113 return m_right; 114 } 115 116 119 public void callVisitors(ExpressionOwner owner, XPathVisitor visitor) 120 { 121 if(visitor.visitUnaryOperation(owner, this)) 122 { 123 m_right.callVisitors(this, visitor); 124 } 125 } 126 127 128 131 public Expression getExpression() 132 { 133 return m_right; 134 } 135 136 139 public void setExpression(Expression exp) 140 { 141 exp.exprSetParent(this); 142 m_right = exp; 143 } 144 145 148 public boolean deepEquals(Expression expr) 149 { 150 if(!isSameClass(expr)) 151 return false; 152 153 if(!m_right.deepEquals(((UnaryOperation)expr).m_right)) 154 return false; 155 156 return true; 157 } 158 159 160 } 161 | Popular Tags |