Class StylesheetSource

  extended by com.novell.nds.dirxml.util.mail.FileSource
      extended by com.novell.nds.dirxml.util.mail.XmlDocumentSource
          extended by com.novell.nds.dirxml.util.mail.StylesheetSource

public class StylesheetSource
extends XmlDocumentSource

Manager class that will find and construct XSLT stylesheets. The stylesheets are cached.

Note that changes to the stylesheet sources are not picked up, so the driver must be shut down and restarted in order to get changed stylesheets.

Constructor Summary
StylesheetSource(String dnBase, File pathBase)
          Construct a StylesheetSource with the passed bases.
Method Summary
 Stylesheet getStylesheet(String path)
          Find and parse an XSLT stylesheet in the directory or file system.
 void releaseStylesheet(Stylesheet stylesheet)
          Call when finished using a Stylesheet returned by getStylesheet().
Methods inherited from class com.novell.nds.dirxml.util.mail.XmlDocumentSource
Methods inherited from class com.novell.nds.dirxml.util.mail.FileSource
getFile, getFile, resolveFilename
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public StylesheetSource(String dnBase,
                        File pathBase)
Construct a StylesheetSource with the passed bases.

pathBase - Base location for files in file system.
dnBase - Base location for objects in directory.
Method Detail


public Stylesheet getStylesheet(String path)
                         throws IOException
Find and parse an XSLT stylesheet in the directory or file system. Passed path is relative to dnBase or pathBase with which this object was constructed.

The returned stylesheet may be used without further synchronization by the calling thread. releaseStylesheet() must be called when the calling thread is finished using the Stylesheet so that the Stylesheet can be reused by a different thread.

path - Path to XSLT stylesheet.
IOException - If data not found, is invalid XML or XSLT.
See Also:


public void releaseStylesheet(Stylesheet stylesheet)
Call when finished using a Stylesheet returned by getStylesheet().

Calling this method marks the passed Stylesheet as not-in-use so that other threads may use it.

stylesheet - Stylesheet returned from getStylesheet().
See Also: