net.sf.colle.xml
Class Transformation

java.lang.Object
  extended bynet.sf.colle.xml.Transformation

public class Transformation
extends Object

Information regarding a transformation. This object is immutable and contains static information found in a transformation such as processing instructions and a stylesheet. Created: 30 Dec 2001

Version:
$Revision: 1.9 $, $Date: 2004/12/17 07:04:31 $
Author:
Dwayne Schultz

Constructor Summary
Transformation(URL pxStylesheetURL, String psRootNode)
          Constructs a transformation with a path to the stylesheet.
 
Method Summary
static void addDataPath(String psRootNode, String psDataPath, Set pxDataPaths)
          Adds the specfied datapath and all the parent datapaths it implies to the specified set of datapaths.
 String getContentType()
          Returns the mime type of the output based on the output method and media type.
 Set getDataPaths()
          Returns an unmodifiable set of xpath strings representing each object requested by this transformation through process instructions.
 String getFileExtension()
          Returns the common file extension based on the content type.
 String getOutputMediaType()
          Returns the output method as defined in the xsl:output tag.
 String getOutputMethod()
          Returns the output method as defined in the xsl:output tag.
 org.jdom.ProcessingInstruction getProcessingInstruction(String psTarget)
          Returns the processing instruction identified by the given target.
 Map getProcessingInstructions()
          Returns an unmodifiable map of processing instructions keyed by the PI's target.
(package private) static javax.xml.transform.TransformerFactory getTransformerFactory()
           
 boolean isStandalone()
          Returns true if this transformation is to be used only without a controller.
 boolean isUnauthenticated()
          Returns true if this transformation can be viewed by an unauthenticated (anonymous) operator.
 void transform(javax.xml.transform.Source pxSource, javax.xml.transform.Result pxResult)
          Performs this transformation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Transformation

public Transformation(URL pxStylesheetURL,
                      String psRootNode)
               throws FileNotFoundException
Constructs a transformation with a path to the stylesheet.

Parameters:
pxStylesheetURL - location of the stylesheet
psRootNode - name of the root element of the document this stylesheet processes. Typically the main template will have a selection on this node (ie: <xsl:template match="/{psRootNode}" ...).
Method Detail

getTransformerFactory

static javax.xml.transform.TransformerFactory getTransformerFactory()

addDataPath

public static void addDataPath(String psRootNode,
                               String psDataPath,
                               Set pxDataPaths)
Adds the specfied datapath and all the parent datapaths it implies to the specified set of datapaths. For example, if 'xyz/123' is added, both 'xyz' and 'xyz/123' are added to the set.


isStandalone

public boolean isStandalone()
Returns true if this transformation is to be used only without a controller.


isUnauthenticated

public boolean isUnauthenticated()
Returns true if this transformation can be viewed by an unauthenticated (anonymous) operator.


getDataPaths

public Set getDataPaths()
Returns an unmodifiable set of xpath strings representing each object requested by this transformation through process instructions.


getOutputMethod

public String getOutputMethod()
Returns the output method as defined in the xsl:output tag.


getOutputMediaType

public String getOutputMediaType()
Returns the output method as defined in the xsl:output tag.


getProcessingInstructions

public Map getProcessingInstructions()
Returns an unmodifiable map of processing instructions keyed by the PI's target.


getProcessingInstruction

public org.jdom.ProcessingInstruction getProcessingInstruction(String psTarget)
Returns the processing instruction identified by the given target.


getContentType

public String getContentType()
Returns the mime type of the output based on the output method and media type.


getFileExtension

public String getFileExtension()
Returns the common file extension based on the content type. Defaults to empty string.


transform

public void transform(javax.xml.transform.Source pxSource,
                      javax.xml.transform.Result pxResult)
Performs this transformation.