org.activemath.xsl
Class Processor

java.lang.Object
  extended by org.activemath.xsl.Processor
All Implemented Interfaces:
Stylesheets
Direct Known Subclasses:
JaxpProcessor

public abstract class Processor
extends Object
implements Stylesheets

Abstract class Processor

This class impelements the interface stylesheets. Additional 2 constructors and a method convert2jdom is provided


Field Summary
protected  URL baseURI
          the baseURI used to resolve relative URI's the baseURI for the stylesheets
protected static boolean hasGeneratedSymbolImports
           
protected static Logger thisLogCat
          Description of the Field
 
Constructor Summary
Processor()
          Constructor set baseURI to the Manager's one
Processor(String base)
          Constructor
Processor(URL baseURI)
          Constructor
 
Method Summary
 String getBaseURI()
          get the baseURI stylesheets can be relative to
abstract  Templates loadTemplate(String stylesheet)
          get a template for the given stylesheet if the wanted one already exists then return this one else create a new one an return it
abstract  void loadTemplateAsync(String stylesheet)
          Loads a template asynchronously.
 void setBaseURI(String base)
          set the baseURI stylesheets can be relative to
 void setBaseURI(URL base)
          Sets the baseURI attribute of the Processor object
abstract  void transform(org.jdom.Document document, OutputStream outStream, String stylesheet, Hashtable params)
          transform a JDOM document by the given Stylesheet
abstract  void transform(org.jdom.Document document, Result result, String stylesheet, Hashtable params)
          transform a JDOM document by the given Stylesheet
abstract  void transform(org.jdom.Document document, Writer writer, String stylesheet, Hashtable params)
          transform a JDOM document by the given Stylesheet
abstract  void transform(InputStream inStream, OutputStream outStream, String stylesheet, Hashtable params)
          Deprecated. use transform(new StreamSource(inStream), new StreamResult(outStream), stylesheet, params) instead
abstract  void transform(Source inputSource, Result outputResult, String stylesheet, Hashtable params)
          transform a xml document by the given Stylesheet
abstract  org.jdom.Document transform2Jdom(org.jdom.Document document, String stylesheet, Hashtable params)
          transform a jdom document by the given Stylesheet Be aware that the resulting document has to be XML code to output a JDOOM document
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

thisLogCat

protected static Logger thisLogCat
Description of the Field


baseURI

protected URL baseURI
the baseURI used to resolve relative URI's

the baseURI for the stylesheets


hasGeneratedSymbolImports

protected static boolean hasGeneratedSymbolImports
Constructor Detail

Processor

public Processor()
          throws MalformedURLException
Constructor

set baseURI to the Manager's one

Throws:
MalformedURLException - Description of Exception

Processor

public Processor(URL baseURI)
Constructor

Parameters:
baseURI - Description of Parameter

Processor

public Processor(String base)
          throws MalformedURLException
Constructor

Parameters:
base - the base URI of the stylesheets to use
Throws:
MalformedURLException - Description of Exception
Method Detail

setBaseURI

public void setBaseURI(String base)
                throws MalformedURLException
set the baseURI stylesheets can be relative to

Specified by:
setBaseURI in interface Stylesheets
Parameters:
base - the base URI of the stylesheets to use
Throws:
MalformedURLException - If the base URI is malformed

setBaseURI

public void setBaseURI(URL base)
Sets the baseURI attribute of the Processor object

Parameters:
base - The new baseURI value

getBaseURI

public String getBaseURI()
get the baseURI stylesheets can be relative to

Specified by:
getBaseURI in interface Stylesheets
Returns:
the base URI - may be null if the baseURI isn't set yet.

loadTemplate

public abstract Templates loadTemplate(String stylesheet)
                                throws TransformerException
get a template for the given stylesheet

if the wanted one already exists then return this one else create a new one an return it

Specified by:
loadTemplate in interface Stylesheets
Parameters:
stylesheet - the URI of the stylesheet to use for loading (may be absolute or relative to the baseURI)
Returns:
the template for the given stylesheet
Throws:
TransformerException - If anything happens, look for wrapped ones.

loadTemplateAsync

public abstract void loadTemplateAsync(String stylesheet)
Description copied from interface: Stylesheets
Loads a template asynchronously. The processor object (the Stylesheets object) has to wait for the load to be complete before applying the transformation to the named stylesheet.

Specified by:
loadTemplateAsync in interface Stylesheets

transform2Jdom

public abstract org.jdom.Document transform2Jdom(org.jdom.Document document,
                                                 String stylesheet,
                                                 Hashtable params)
                                          throws TransformerException
transform a jdom document by the given Stylesheet

Be aware that the resulting document has to be XML code to output a JDOOM document

Parameters:
document - the jdom document to transform
stylesheet - the URI of the stylesheet used for transformation
params - the parameters used during transformation (as Hashtable) - may be null
Returns:
transformed jdom document
Throws:
TransformerException - Description of Exception

transform

public abstract void transform(org.jdom.Document document,
                               Result result,
                               String stylesheet,
                               Hashtable params)
                        throws TransformerException
transform a JDOM document by the given Stylesheet

Specified by:
transform in interface Stylesheets
Parameters:
document - the JDOM document to transform
result - the Result of the transformation (that means: the transformed document)
stylesheet - the URI of the stylesheet used for transformation
params - the parameters used during transformation (as Hashtable) - may be null
Throws:
TransformerException - Description of Exception

transform

public abstract void transform(org.jdom.Document document,
                               OutputStream outStream,
                               String stylesheet,
                               Hashtable params)
                        throws TransformerException
transform a JDOM document by the given Stylesheet

Specified by:
transform in interface Stylesheets
Parameters:
document - the JDOM document to transform
outStream - the resultingOutputStream of the transformation
stylesheet - the URI of the stylesheet used for transformation
params - the parameters used during transformation (as Hashtable) - may be null
Throws:
TransformerException - Description of Exception

transform

public abstract void transform(org.jdom.Document document,
                               Writer writer,
                               String stylesheet,
                               Hashtable params)
                        throws TransformerException
transform a JDOM document by the given Stylesheet

Specified by:
transform in interface Stylesheets
Parameters:
document - the JDOM document to transform
stylesheet - the URI of the stylesheet used for transformation
params - the parameters used during transformation (as Hashtable) - may be null
writer - Description of Parameter
Throws:
TransformerException - Description of Exception

transform

public abstract void transform(Source inputSource,
                               Result outputResult,
                               String stylesheet,
                               Hashtable params)
                        throws TransformerException
transform a xml document by the given Stylesheet

Specified by:
transform in interface Stylesheets
Parameters:
inputSource - the Source of the xml document to transform
outputResult - the Result of the transformation (that means: the transformed document)
stylesheet - the URI of the stylesheet used for transformation
params - the parameters used during transformation (as Hashtable) - may be null
Throws:
TransformerException - Description of Exception

transform

public abstract void transform(InputStream inStream,
                               OutputStream outStream,
                               String stylesheet,
                               Hashtable params)
                        throws TransformerException
Deprecated. use transform(new StreamSource(inStream), new StreamResult(outStream), stylesheet, params) instead

transform a xml document by the given Stylesheet

Specified by:
transform in interface Stylesheets
Parameters:
inStream - the InputStream of the xml document to transform
outStream - the resultingOutputStream of the transformation
stylesheet - the URI of the stylesheet used for transformation
params - the parameters used during transformation (as Hashtable) - may be null
Throws:
TransformerException - Description of Exception