org.cip4.jdflib.elementwalker
Class XPathWalker

java.lang.Object
  extended by org.cip4.jdflib.elementwalker.ElementWalker
      extended by org.cip4.jdflib.elementwalker.BaseElementWalker
          extended by org.cip4.jdflib.elementwalker.XPathWalker

public class XPathWalker
extends BaseElementWalker

Author:
Rainer Prosi, Heidelberger Druckmaschinen walker that writes XPaths of all elements to a file

Nested Class Summary
 class XPathWalker.WalkAll
          the link and ref walker
protected  class XPathWalker.XPathBuilder
           
 
Field Summary
 VString attNames
          the attribute names to set as [@att] rather than [n] if method=3
 int method
          the method to create xpaths
protected  Set<String> pathsFound
           
protected  PrintWriter writer
           
 
Fields inherited from class org.cip4.jdflib.elementwalker.BaseElementWalker
log
 
Fields inherited from class org.cip4.jdflib.elementwalker.ElementWalker
theFactory
 
Constructor Summary
XPathWalker(File xpathOutput)
           
XPathWalker(PrintWriter w)
           
 
Method Summary
protected  BaseWalkerFactory getFactory()
           
 void setAttribute(boolean attribute)
          if true, include attributes
 void setAttributeValue(boolean attribute)
          if true, include attribute values
 void setBElement(boolean element)
           
 void setDatatype(boolean datatype)
           
 void setMethod(int method)
           
 void setSeparator(String separator)
           
 void setUnique(boolean unique)
           
 int walkAll(KElement e)
           
 
Methods inherited from class org.cip4.jdflib.elementwalker.BaseElementWalker
constructWalkers
 
Methods inherited from class org.cip4.jdflib.elementwalker.ElementWalker
toString, walkTree, walkTreeKidsFirst
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

attNames

public VString attNames
the attribute names to set as [@att] rather than [n] if method=3


method

public int method
the method to create xpaths


writer

protected final PrintWriter writer

pathsFound

protected Set<String> pathsFound
Constructor Detail

XPathWalker

public XPathWalker(File xpathOutput)
            throws FileNotFoundException
Parameters:
xpathOutput -
Throws:
FileNotFoundException

XPathWalker

public XPathWalker(PrintWriter w)
Parameters:
w -
Method Detail

walkAll

public int walkAll(KElement e)
Parameters:
e -
Returns:
the number of xpaths

setAttribute

public void setAttribute(boolean attribute)
if true, include attributes

Parameters:
attribute -

setAttributeValue

public void setAttributeValue(boolean attribute)
if true, include attribute values

Parameters:
attribute -

getFactory

protected BaseWalkerFactory getFactory()
Overrides:
getFactory in class BaseElementWalker
Returns:
the factory for this worker

setMethod

public void setMethod(int method)
Parameters:
method - the method to set

setUnique

public void setUnique(boolean unique)
Parameters:
unique - the method to set

setDatatype

public void setDatatype(boolean datatype)
Parameters:
datatype - the bDatatype to set

setSeparator

public void setSeparator(String separator)
Parameters:
separator - the separator to set

setBElement

public void setBElement(boolean element)
Parameters:
element - the bElement to set


Copyright © 2013. All Rights Reserved.