com.xml_project.morganaxproc.connectors
Class FOConnector

java.lang.Object
  extended by com.xml_project.morganaxproc.connectors.FOConnector

public abstract class FOConnector
extends java.lang.Object

This class defines an interface for the use of XSL FO processors with MorganaXProc. It allows you to use any FO processor you like in 'p:xsl-formatter' by just wrapping a FOConnector around it.


Nested Class Summary
static class FOConnector.FOConnectorException
           
 
Constructor Summary
FOConnector()
           
 
Method Summary
abstract  void format(nu.xom.Document doc, java.util.Properties parameters, java.lang.String stepURI, java.io.OutputStream stream, java.lang.String contentType, java.io.PrintStream messageChannel)
          Does the actual transformation
protected static java.lang.Boolean getBooleanProperty(java.util.Properties props, java.lang.String propName)
          Static method to return a boolean property with a given name from the property map
protected static java.util.Date getDateProperty(java.util.Properties props, java.lang.String propName)
          Static method to return a date property with a given name from the property map
protected static java.lang.Float getFloatProperty(java.util.Properties props, java.lang.String propName)
          Static method to return a float property with a given name from the property map
abstract  java.lang.String getInfoString()
          Called in initialization to issue copyright information etc.
protected static java.lang.Integer getIntProperty(java.util.Properties props, java.lang.String propName)
          Static method to return an integer property with a given name from the property map
protected static java.lang.String getStringProperty(java.util.Properties props, java.lang.String propName)
          Static method to return a property with a given name from the property map
static FOConnector newInstance(java.lang.String className, java.io.PrintWriter infoWriter, java.io.PrintStream messageStream)
          Creates a new instance of a FOConnector using the class the given class name.
static FOConnector newInstance(XProcConfiguration config, java.io.PrintWriter infoWriter, java.io.PrintStream messageStream)
          Creates a new instance of a FOConnector using the class defined in XProcConfiguration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FOConnector

public FOConnector()
Method Detail

getInfoString

public abstract java.lang.String getInfoString()
Called in initialization to issue copyright information etc.

Returns:
the information to show

format

public abstract void format(nu.xom.Document doc,
                            java.util.Properties parameters,
                            java.lang.String stepURI,
                            java.io.OutputStream stream,
                            java.lang.String contentType,
                            java.io.PrintStream messageChannel)
                     throws FOConnector.FOConnectorException
Does the actual transformation

Parameters:
doc - the document
parameters - the parameters
stepURI - the steps uri
stream - the stream to which the output should be written
contentType - the content-type of the output
messageChannel - might be used to output messages. May be null.
Throws:
FOConnector.FOConnectorException - when an error occurs

newInstance

public static final FOConnector newInstance(XProcConfiguration config,
                                            java.io.PrintWriter infoWriter,
                                            java.io.PrintStream messageStream)
                                     throws FOConnector.FOConnectorException
Creates a new instance of a FOConnector using the class defined in XProcConfiguration. This method is called before the execution of the pipeline by MorganaXProc.

Parameters:
config - the XProcConfiguration to use.
infoWriter - the PrintWriter for messages or null.
messageStream - the PrintStream for copyright messages.
Returns:
the newly created FOConnector.
Throws:
FOConnector.FOConnectorException - if any exception occurs in creating the new FOConnector.

newInstance

public static final FOConnector newInstance(java.lang.String className,
                                            java.io.PrintWriter infoWriter,
                                            java.io.PrintStream messageStream)
                                     throws FOConnector.FOConnectorException
Creates a new instance of a FOConnector using the class the given class name. This method is called before the execution of the pipeline by MorganaXProc.

Parameters:
className - A class name for the FOConnector to create.
infoWriter - the PrintWriter for messages or null.
messageStream - the PrintStream for copyright messages.
Returns:
the newly created FOConnector.
Throws:
FOConnector.FOConnectorException - if any exception occurs in creating the new FOConnector.

getStringProperty

protected static java.lang.String getStringProperty(java.util.Properties props,
                                                    java.lang.String propName)
Static method to return a property with a given name from the property map

Parameters:
props - the property map
propName - the name of the property to return
Returns:
the value of the property or null

getBooleanProperty

protected static java.lang.Boolean getBooleanProperty(java.util.Properties props,
                                                      java.lang.String propName)
Static method to return a boolean property with a given name from the property map

Parameters:
props - the property map
propName - the name of the property to return
Returns:
true or false or null

getFloatProperty

protected static java.lang.Float getFloatProperty(java.util.Properties props,
                                                  java.lang.String propName)
Static method to return a float property with a given name from the property map

Parameters:
props - the property map
propName - the name of the property to return
Returns:
the value or null (if no property with this name is found or value is no float)

getDateProperty

protected static java.util.Date getDateProperty(java.util.Properties props,
                                                java.lang.String propName)
Static method to return a date property with a given name from the property map

Parameters:
props - the property map
propName - the name of the property to return
Returns:
the value or null (if no property with this name is found or value is no date)

getIntProperty

protected static java.lang.Integer getIntProperty(java.util.Properties props,
                                                  java.lang.String propName)
Static method to return an integer property with a given name from the property map

Parameters:
props - the property map
propName - the name of the property to return
Returns:
the value or null (if no property with this name is found or value is no integer)