Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.websody.corefunc
Class XMLCollector  view XMLCollector download XMLCollector.java

java.lang.Object
  extended byorg.websody.GenericFunction
      extended byorg.websody.corefunc.XMLCollector
All Implemented Interfaces:
org.websody.Function, javax.xml.transform.URIResolver

public class XMLCollector
extends org.websody.GenericFunction
implements javax.xml.transform.URIResolver

Walks through a directory tree and collects xml files. If a file matches a certain criteria (specified by a set of regexps), one or more xpath expressions are applied and a wrapper document containing the results is build. Afterwards a xsl transformation is performed.


Field Summary
private  int depth
           
private  java.lang.String[] exclude
           
private  java.lang.String[] include
           
private  java.lang.String path
           
private  java.lang.String stylesheet
           
private  java.lang.String[] xpath
           
 
Fields inherited from class org.websody.GenericFunction
log, out, request, servletContext
 
Constructor Summary
XMLCollector()
           
 
Method Summary
 java.lang.Object execute()
           
protected  java.util.Iterator getFiles(boolean ommitDirs)
           
protected  java.lang.String getLink(java.io.File f)
           
 void init()
           
 long lastModified()
           
 javax.xml.transform.Source resolve(java.lang.String href, java.lang.String base)
          Resolves an xsl:include, xsl:import, or XPath document() function.
 void setDepth(java.lang.String depth)
           
 void setExclude(java.lang.String[] exclude)
           
 void setInclude(java.lang.String[] include)
           
 void setPath(java.lang.String path)
           
 void setStylesheet(java.lang.String stylesheet)
           
 void setXPath(java.lang.String[] xpath)
           
 
Methods inherited from class org.websody.GenericFunction
getLifetime, setLifetime, setLifetime, setOut, setRequest, setServletContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

path

private java.lang.String path

xpath

private java.lang.String[] xpath

stylesheet

private java.lang.String stylesheet

include

private java.lang.String[] include

exclude

private java.lang.String[] exclude

depth

private int depth
Constructor Detail

XMLCollector

public XMLCollector()
Method Detail

init

public void init()
Specified by:
init in interface org.websody.Function

setPath

public void setPath(java.lang.String path)

setXPath

public void setXPath(java.lang.String[] xpath)

setStylesheet

public void setStylesheet(java.lang.String stylesheet)

setInclude

public void setInclude(java.lang.String[] include)

setExclude

public void setExclude(java.lang.String[] exclude)

setDepth

public void setDepth(java.lang.String depth)

lastModified

public long lastModified()
Specified by:
lastModified in interface org.websody.Function

execute

public java.lang.Object execute()
                         throws java.lang.Exception
Specified by:
execute in interface org.websody.Function

getLink

protected java.lang.String getLink(java.io.File f)

getFiles

protected java.util.Iterator getFiles(boolean ommitDirs)
                               throws java.lang.Exception

resolve

public javax.xml.transform.Source resolve(java.lang.String href,
                                          java.lang.String base)
Description copied from interface: javax.xml.transform.URIResolver
Resolves an xsl:include, xsl:import, or XPath document() function.

Specified by:
resolve in interface javax.xml.transform.URIResolver