com.jrefinery.report.targets.pageable.operations
Class OperationFactory

java.lang.Object
  |
  +--com.jrefinery.report.targets.pageable.operations.OperationFactory

public class OperationFactory
extends java.lang.Object

The OperationFactory is used to transform content into OutputTarget operations.

Author:
Thomas Morgner
See Also:
OutputTarget, Content

Constructor Summary
OperationFactory()
          Default constructor.
 
Method Summary
 boolean canHandleContent(java.lang.String contentType)
          Tests, whether this implementation would be able to handle the given content type.
 void createOperations(PhysicalOperationsCollector col, Element e, Content value, java.awt.geom.Rectangle2D bounds)
          Creates the required Operations to output the content on an OutputTarget.
 OperationModule getModule(java.lang.String content)
          Returns the first module in the factory that can handle the specified content.
 void registerModule(OperationModule module)
          Registered a module with the factory.
 void unregisterModule(OperationModule module)
          Deregisters a module with the factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OperationFactory

public OperationFactory()
Default constructor.

Method Detail

registerModule

public void registerModule(OperationModule module)
Registered a module with the factory.

Parameters:
module - the module.

unregisterModule

public void unregisterModule(OperationModule module)
Deregisters a module with the factory.

Parameters:
module - the module.

getModule

public OperationModule getModule(java.lang.String content)
                          throws OutputTargetException
Returns the first module in the factory that can handle the specified content. ToDo: Add better support for specific and generic content handler. Specific handler should be always preferred to more generic handlers.

Parameters:
content - the content type.
Returns:
the module or null if no handler is registered for that content-type.
Throws:
OutputTargetException - if no module was found for the given content.

canHandleContent

public boolean canHandleContent(java.lang.String contentType)
Tests, whether this implementation would be able to handle the given content type.

Parameters:
contentType - the to be tested content type.
Returns:
true, if this kind of content can be handled, false otherwise.

createOperations

public void createOperations(PhysicalOperationsCollector col,
                             Element e,
                             Content value,
                             java.awt.geom.Rectangle2D bounds)
                      throws OutputTargetException
Creates the required Operations to output the content on an OutputTarget.

Parameters:
e - the element that contained the raw data for the content.
value - the content that should be printed.
bounds - the content bounds.
col - the operations collector for the ops.
Throws:
OutputTargetException - if this factory is not able to handle that content.