1 16 19 package org.apache.xalan.templates; 20 21 import java.util.Vector ; 22 23 import org.apache.xml.utils.QName; 24 import org.apache.xpath.ExpressionOwner; 25 import org.apache.xpath.XPathVisitor; 26 import org.apache.xpath.operations.Variable; 27 28 31 public class VarNameCollector extends XPathVisitor 32 { 33 Vector m_refs = new Vector (); 34 35 38 public void reset() 39 { 40 m_refs.removeAllElements(); } 42 43 47 public int getVarCount() 48 { 49 return m_refs.size(); 50 } 51 52 59 boolean doesOccur(QName refName) 60 { 61 return m_refs.contains(refName); 62 } 63 64 71 public boolean visitVariableRef(ExpressionOwner owner, Variable var) 72 { 73 m_refs.addElement(var.getQName()); 74 return true; 75 } 76 77 } 78 79 | Popular Tags |