jd.xml.xslt
Class AbstractStylesheet

java.lang.Object
  extended byjd.xml.xslt.Transformation
      extended byjd.xml.xslt.AbstractStylesheet
Direct Known Subclasses:
Stylesheet

public abstract class AbstractStylesheet
extends Transformation

A XSLT stylesheet base class.


Field Summary
protected  Hashtable decimalFormatSymbols_
           
protected  Hashtable keys_
           
protected  MessageListener messageListener_
           
protected  NodeNamePool nodeNamePool_
           
protected  OutputFormat outputFormat_
           
protected  XsltSecurityManager securityManager_
           
protected  VerboseLog verboseLog_
           
protected  int warningLevel_
           
 
Constructor Summary
AbstractStylesheet()
          Create a Stylesheet.
 
Method Summary
 NodeNamePool getNodeNamePool()
          Return the NodeNamePool of the stylesheet.
 OutputFormat getOutputFormat()
          Return the OutputFormat.
protected abstract  boolean isSetup()
          Test if the stylesheet has been initialized.
 void setMessageListener(MessageListener listener)
          Specify a message listener that gets invoked if a xsl:message instruction is processed.
 boolean setParameter(String name, Object value)
          Set the value of a top-level parameter.
 boolean setParameter(String namespaceUri, String name, Object value)
          Set the value of a top-level parameter with a qualified name.
protected abstract  boolean setParameterInternal(String name, XObject value)
          Set the value of an global parameter.
 void setSecurityManager(XsltSecurityManager manager)
          Set the security manager of the stylesheet.
 void setVerboseLog(VerboseLog log)
          Set the verbose log.
 void setWarningLevel(int warningLevel)
          Set the warning level.
 void transform(XmlSource source, XsltResult result, int repeat)
          Transform the source to the result.
protected abstract  void transformInternal(XmlSource source, XsltResult result, int repeat)
           
 
Methods inherited from class jd.xml.xslt.Transformation
clearParameters, setEntityResolver, setTrace, setUriResolver, setValidate, setVerbose, transform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

keys_

protected Hashtable keys_

decimalFormatSymbols_

protected Hashtable decimalFormatSymbols_

messageListener_

protected MessageListener messageListener_

nodeNamePool_

protected NodeNamePool nodeNamePool_

verboseLog_

protected VerboseLog verboseLog_

warningLevel_

protected int warningLevel_

securityManager_

protected XsltSecurityManager securityManager_

outputFormat_

protected OutputFormat outputFormat_
Constructor Detail

AbstractStylesheet

public AbstractStylesheet()
Create a Stylesheet.

Method Detail

isSetup

protected abstract boolean isSetup()
Test if the stylesheet has been initialized.


setWarningLevel

public void setWarningLevel(int warningLevel)
Set the warning level.

Specified by:
setWarningLevel in class Transformation

setVerboseLog

public void setVerboseLog(VerboseLog log)
Set the verbose log.

Specified by:
setVerboseLog in class Transformation

setMessageListener

public void setMessageListener(MessageListener listener)
Specify a message listener that gets invoked if a xsl:message instruction is processed.

Specified by:
setMessageListener in class Transformation

setParameter

public boolean setParameter(String name,
                            Object value)
Set the value of a top-level parameter. This method throws an exception if the stylesheet has not been setup before.

Specified by:
setParameter in class Transformation
Parameters:
name - the parameter name
value - the parameter value
Returns:
return if the parameter was defined in the stylesheet

setParameter

public boolean setParameter(String namespaceUri,
                            String name,
                            Object value)
Set the value of a top-level parameter with a qualified name.

Parameters:
name - the namespace uri of the parameter name.
value - the parameter value
Returns:
return if the parameter was defined in the stylesheet

setParameterInternal

protected abstract boolean setParameterInternal(String name,
                                                XObject value)
Set the value of an global parameter. The method is only called if isSetup returns true.

Returns:
return if the parameter was defined in the stylesheet

getOutputFormat

public OutputFormat getOutputFormat()
Return the OutputFormat.

Specified by:
getOutputFormat in class Transformation

setSecurityManager

public void setSecurityManager(XsltSecurityManager manager)
Set the security manager of the stylesheet. Per default the stylesheet uses the global SecurityManager.

Specified by:
setSecurityManager in class Transformation
Throws:
SecurityException - thrown if the manager can not be replaced.

getNodeNamePool

public NodeNamePool getNodeNamePool()
Return the NodeNamePool of the stylesheet. Since the pool can be changed a copy is returned.

Specified by:
getNodeNamePool in class Transformation

transform

public void transform(XmlSource source,
                      XsltResult result,
                      int repeat)
               throws SAXException,
                      IOException,
                      XsltException
Transform the source to the result.

Specified by:
transform in class Transformation
Parameters:
source - the transformation source
result - the transformation result
repeat - repeat the transformation n times. A repeat value greater 1 is used for timing purpose and may not be supported by the transformation
Throws:
IOException - if an I/O error occurrs
SAXException - if the source document cannot be parsed
XsltException - if a transformation error occurrs

transformInternal

protected abstract void transformInternal(XmlSource source,
                                          XsltResult result,
                                          int repeat)
                                   throws Exception
Throws:
Exception