org.foray.core
Class FOraySession

java.lang.Object
  extended by org.foray.core.FOraySession

public class FOraySession
extends Object

The ancestor class for all FOray processing. All classes that start FOray processing need to create a FOraySession, one or more FOrayDocument instances, and one or more FOrayTarget instances for each FOrayDocument, then run the FOraySession process() method. This process is illustrated and documented in the source code for the CommandLineStarter.run() method. After instantiating FOraySession, additional Namespace instances can be registered with the session through the addNamespace method. Custom Namespaces can also be added to the system resources, and these are automatically registered at runtime. The input document is identified to the FOrayDocument as it is instantiated. There are two constructors, one for SAX input, and the other for DOM input. The Renderer, LayoutStrategy, and output document are identified to the FOrayTarget as it is instantiated.


Constructor Summary
FOraySession(org.apache.commons.logging.Log logger, SessionConfig configuration, org.axsl.font.FontServer fontServer, org.axsl.hyphen.HyphenationServer hyphenServer, org.axsl.text.TextServer textServer, org.axsl.graphic.GraphicServer graphicServer, org.axsl.speech.SpeechServer speechServer, org.axsl.fo.FoTreeFactory foTreeFactory, org.axsl.area.AreaTreeFactory areaTreeFactory, org.axsl.layout.LayoutFactory layoutFactory)
          Constructor.
 
Method Summary
 org.axsl.area.AreaTreeFactory getAreaTreeFactory()
          Returns the AreaTreeFactory.
 EntityResolver getEntityResolver()
          Returns the entity resolver for this session.
 org.axsl.font.FontServer getFontServer()
          Returns the font server for this session.
 org.axsl.fo.FoTreeFactory getFOTreeFactory()
          Returns the FOTreeFactory.
 org.axsl.graphic.GraphicServer getGraphicServer()
          Returns the GraphicServer.
 org.axsl.hyphen.HyphenationServer getHyphenationServer()
          Returns the HyphenationServer.
 org.axsl.layout.LayoutFactory getLayoutFactory()
          Returns the LayoutFactory.
 org.apache.commons.logging.Log getLogger()
          Returns the logger for this session.
 SessionConfig getSessionConfig()
          Returns the SessionConfig.
 org.axsl.speech.SpeechServer getSpeechServer()
          Returns the speech server.
 org.axsl.text.TextServer getTextServer()
          Returns the TextServer.
 void process()
          Iterates through the collection of FOrayDocuments to be processed, and processes each one.
protected  void registerDocument(FOrayDocument document)
          Registers a FOrayDocument instance that this FOraySession should process.
 void setEntityResolver(EntityResolver entityResolver)
          Sets the EntityResolver that should be used to resolve XML entities.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FOraySession

public FOraySession(org.apache.commons.logging.Log logger,
                    SessionConfig configuration,
                    org.axsl.font.FontServer fontServer,
                    org.axsl.hyphen.HyphenationServer hyphenServer,
                    org.axsl.text.TextServer textServer,
                    org.axsl.graphic.GraphicServer graphicServer,
                    org.axsl.speech.SpeechServer speechServer,
                    org.axsl.fo.FoTreeFactory foTreeFactory,
                    org.axsl.area.AreaTreeFactory areaTreeFactory,
                    org.axsl.layout.LayoutFactory layoutFactory)
             throws FOrayException
Constructor.

Parameters:
logger - The (optional) logger that should be used for this session. If null is passed, a default Logger will be created.
configuration - The Configuration instance that should be used with this session.
fontServer - The (optional) FontServer instance that should be used for this session. If null is passed, then a FontServer instance will be created by this FOraySession. If an instance is passed, it needs to be fully configured and ready to be used.
hyphenServer - The HyphenationServer instance that should be used for this session.
textServer - The (optional) TextServer instance that should be used for this session. If null is passed, then a TextServer instance will be created by this FOraySession. If an instance is passed, it needs to be fully configured and ready to be used.
graphicServer - The (optional) GraphicServer instance that should be used for this session. If null is passed, then a GraphicServer instance will be created by this FOray Session. If an instance is passed, it needs to be fully configured and ready to be used.
speechServer - The SpeechServer instance that should be used for this session.
foTreeFactory - The FOTreeFactory that should be used for this session.
areaTreeFactory - The AreaTreeFactory that should be used for this session.
layoutFactory - The LayoutFactory that should be used for this session.
Throws:
FOrayException - For invalid parameters.
Method Detail

getLogger

public org.apache.commons.logging.Log getLogger()
Returns the logger for this session.

Returns:
The logger.

registerDocument

protected void registerDocument(FOrayDocument document)
Registers a FOrayDocument instance that this FOraySession should process.

Parameters:
document - The FOrayDocument instance that should be processed.

getFontServer

public org.axsl.font.FontServer getFontServer()
Returns the font server for this session.

Returns:
The FontServer instance that is being used in this session.

getHyphenationServer

public org.axsl.hyphen.HyphenationServer getHyphenationServer()
Returns the HyphenationServer.

Returns:
The HyphenationServer.

getSpeechServer

public org.axsl.speech.SpeechServer getSpeechServer()
Returns the speech server.

Returns:
The speech server.

getTextServer

public org.axsl.text.TextServer getTextServer()
Returns the TextServer.

Returns:
The TextServer.

getGraphicServer

public org.axsl.graphic.GraphicServer getGraphicServer()
Returns the GraphicServer.

Returns:
The GraphicServer.

getSessionConfig

public SessionConfig getSessionConfig()
Returns the SessionConfig.

Returns:
The SessionConfig.

process

public void process()
             throws FOrayException
Iterates through the collection of FOrayDocuments to be processed, and processes each one.

Throws:
FOrayException - For errors during document processing.

getFOTreeFactory

public org.axsl.fo.FoTreeFactory getFOTreeFactory()
Returns the FOTreeFactory.

Returns:
The FOTreeFactory.

setEntityResolver

public void setEntityResolver(EntityResolver entityResolver)
Sets the EntityResolver that should be used to resolve XML entities.

Parameters:
entityResolver - The EntityResolver that should be set.

getEntityResolver

public EntityResolver getEntityResolver()
Returns the entity resolver for this session.

Returns:
The EntityResolver that should be used to resolve XML entities.

getAreaTreeFactory

public org.axsl.area.AreaTreeFactory getAreaTreeFactory()
Returns the AreaTreeFactory.

Returns:
The AreaTreeFactory.

getLayoutFactory

public org.axsl.layout.LayoutFactory getLayoutFactory()
Returns the LayoutFactory.

Returns:
The LayoutFactory.


Copyright © 2017. All rights reserved.