emolib.util.printer
Class Printer

java.lang.Object
  extended by emolib.util.proc.TextDataProcessor
      extended by emolib.util.printer.Printer
All Implemented Interfaces:
Configurable, DataProcessor

public class Printer
extends TextDataProcessor

The Printer class provides a device to output the content of the data flowing in the processing pipeline.

The Printer can be configured through the XML configuration file to output various types of information. Its inclusion is not restricted to any part of the processing chain. The idea is that the Printer enables the check-out procedure to be carried out easily and securely thus being a trustful monitor for the application.

The different configuration parameters are listed as follows:

Author:
Alexandre Trilla (atrilla@salle.url.edu)

Field Summary
static java.lang.String PROP_EMOTIONAL_WORDS
           
static java.lang.String PROP_MODIFIERS
           
static java.lang.String PROP_NOUNS
           
static java.lang.String PROP_NUMBER_WORDS
           
static java.lang.String PROP_STEMMED_SYNONYMS
           
static java.lang.String PROP_STEMS
           
static java.lang.String PROP_SYNONYMS
           
static java.lang.String PROP_WORD_CLASS
           
static java.lang.String PROP_WORD_POS
           
 
Constructor Summary
Printer()
          Main constructor of the Printer.
 
Method Summary
 void applyPrinting(TextData inputTextDataObject)
          Method to perform the printing process.
 Data getData()
          Obtains the TextData from the previous module, processes it and makes it available to the rest of the text processing chain.
 void initialize()
          Method to initialize the Printer.
 void newProperties(PropertySheet ps)
          This method is called when this configurable component has new data.
 void register(java.lang.String name, Registry registry)
          Register my properties.
 
Methods inherited from class emolib.util.proc.TextDataProcessor
flush, getName, getPredecessor, setPredecessor, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROP_SYNONYMS

public static final java.lang.String PROP_SYNONYMS
See Also:
Constant Field Values

PROP_NUMBER_WORDS

public static final java.lang.String PROP_NUMBER_WORDS
See Also:
Constant Field Values

PROP_MODIFIERS

public static final java.lang.String PROP_MODIFIERS
See Also:
Constant Field Values

PROP_EMOTIONAL_WORDS

public static final java.lang.String PROP_EMOTIONAL_WORDS
See Also:
Constant Field Values

PROP_STEMS

public static final java.lang.String PROP_STEMS
See Also:
Constant Field Values

PROP_STEMMED_SYNONYMS

public static final java.lang.String PROP_STEMMED_SYNONYMS
See Also:
Constant Field Values

PROP_NOUNS

public static final java.lang.String PROP_NOUNS
See Also:
Constant Field Values

PROP_WORD_CLASS

public static final java.lang.String PROP_WORD_CLASS
See Also:
Constant Field Values

PROP_WORD_POS

public static final java.lang.String PROP_WORD_POS
See Also:
Constant Field Values
Constructor Detail

Printer

public Printer()
Main constructor of the Printer.

Method Detail

register

public void register(java.lang.String name,
                     Registry registry)
              throws PropertyException
Description copied from interface: Configurable
Register my properties. This method is called once early in the time of the component, shortly after the component is constructed. This component should register any configuration properties that it needs to register. If this configurable extends another configurable, super.register should also be called

Specified by:
register in interface Configurable
Overrides:
register in class TextDataProcessor
Parameters:
name - the name of the component
registry - the registry for this component
Throws:
PropertyException

newProperties

public void newProperties(PropertySheet ps)
                   throws PropertyException
Description copied from interface: Configurable
This method is called when this configurable component has new data. The component should first validate the data. If it is bad the component should return false. If the data is good, the component should record the the data internally and return true.

Specified by:
newProperties in interface Configurable
Overrides:
newProperties in class TextDataProcessor
Parameters:
ps - a property sheet holding the new data
Throws:
PropertyException - if there is a problem with the properties.

getData

public Data getData()
             throws DataProcessingException
Obtains the TextData from the previous module, processes it and makes it available to the rest of the text processing chain.

Specified by:
getData in interface DataProcessor
Specified by:
getData in class TextDataProcessor
Returns:
The next available Data object, returns null if no Data object is available.
Throws:
DataProcessingException - If there is a processing error.

initialize

public void initialize()
Method to initialize the Printer.

Specified by:
initialize in interface DataProcessor
Overrides:
initialize in class TextDataProcessor

applyPrinting

public void applyPrinting(TextData inputTextDataObject)
Method to perform the printing process.

Parameters:
inputTextDataObject - The TextData object to process.