org.activemath.util.OMconverters
Class OMConvertByStylesheet

java.lang.Object
  extended by org.activemath.util.OMconverters.OMConvertByStylesheet
All Implemented Interfaces:
OMConverter

public class OMConvertByStylesheet
extends Object
implements OMConverter

Class OMConvertByStylesheet

converter made for converting OMOBJ to other standards for mathematics (e.g. POST) using given stylesheets

Version:
1.0

Constructor Summary
OMConvertByStylesheet(String stylesheetName)
          instantiates the Converter with use of org.activemath.config.Manager for finding and loading the stylesheet
OMConvertByStylesheet(String baseURI, String stylesheetName, Hashtable params)
          instantiates the Converter (org.activemath.config.Manager is not used therefore)
 
Method Summary
 String convert(InputStream inputStream)
          convert from an inputstream
 String convert(String stringToConvert)
          convert from an inputstring
 String convertFromMBase(MBaseRef mbaseRef, MBaseID id)
          convert from MBase content
 void convertStreams(InputStream input, OutputStream output)
          converts from one stream to another one
static void main(String[] args)
          main method for testing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OMConvertByStylesheet

public OMConvertByStylesheet(String baseURI,
                             String stylesheetName,
                             Hashtable params)
                      throws OMConvertException
instantiates the Converter (org.activemath.config.Manager is not used therefore)

Parameters:
baseURI - baseURL where to find the stylesheets
stylesheetName - Name of the stylesheet used for conversion
param - parameter for stylesheet transformation
Throws:
throws - OMConvertException if the constructor was not able to load the stylesheet
OMConvertException

OMConvertByStylesheet

public OMConvertByStylesheet(String stylesheetName)
                      throws OMConvertException
instantiates the Converter with use of org.activemath.config.Manager for finding and loading the stylesheet

Parameters:
stylesheetName - Name of the stylesheet used for conversion
Throws:
throws - OMConvertException if the constructor was not able to load the stylesheet
OMConvertException
Method Detail

convertStreams

public void convertStreams(InputStream input,
                           OutputStream output)
                    throws OMConvertException
converts from one stream to another one

Specified by:
convertStreams in interface OMConverter
Parameters:
input - the inputstream to convert from
output - the outputstream to convert to
Throws:
throws - OMConvertException if the conversion failed
OMConvertException

convert

public String convert(InputStream inputStream)
               throws OMConvertException
convert from an inputstream

Specified by:
convert in interface OMConverter
Parameters:
inputStream - the inputstream to convert from
Returns:
conversion as String
Throws:
throws - OMConvertException if the conversion failed
OMConvertException

convert

public String convert(String stringToConvert)
               throws OMConvertException
convert from an inputstring

Specified by:
convert in interface OMConverter
Parameters:
stringToConvert - the string to convert from
Returns:
conversion as String
Throws:
throws - OMConvertException if the conversion failed
OMConvertException

convertFromMBase

public String convertFromMBase(MBaseRef mbaseRef,
                               MBaseID id)
                        throws OMConvertException
convert from MBase content

Specified by:
convertFromMBase in interface OMConverter
Parameters:
id - Identification of the content from MBase to convert
mbaseRef - the reference to an existing MBase
Returns:
conversion as String
Throws:
throws - OMConvertException if the conversion failed
OMConvertException

main

public static void main(String[] args)
main method for testing