Jumpi v1.2.0

org.jumpi.impl
Class AbstractTransformer

java.lang.Object
  |
  +--org.jumpi.impl.AbstractTransformer
All Implemented Interfaces:
Component, Configurable, Manageable, Transformer
Direct Known Subclasses:
DeserializeTransformer, SerializeTransformer

public abstract class AbstractTransformer
extends java.lang.Object
implements Transformer

An AbstractTransformer is an empty Component which supports no management operations and the configuration of a sole next Transformer, for forward transformation linking. A concrete implementation of an AbstractTransformer must simply implement a transform(org.jumpi.spi.Envelope) method and pass the transformation on to the next Transformer when finished its own transformation.


Field Summary
protected  boolean exceptionOnMismatch_
          Whether to throw an Exception if the transformation input conditions are not met.
protected  Jumpi jumpi_
          The Jumpi instance root component.
protected  java.lang.String name_
          The component's name.
protected  Transformer nextTransformer_
          The next Transformer to call once the own transformation is performed.
protected  boolean warnOnMismatch_
          Whether to warn if the transformation input conditions are not met.
 
Constructor Summary
AbstractTransformer()
           
 
Method Summary
 void configure(java.lang.String name, Properties props)
           Configure the AbstractTransformer instance.
protected  void doNextTransformation(Envelope env)
          Pass the Envelope on to the next Transformer in the processing chain.
 java.lang.String getName()
          Get the fully qualified name of the instance.
 void manage(Component root, Component parent, java.lang.String operation, java.util.Hashtable parameters)
          Perform a recursive management operation through the Jumpi component tree, using the parameters provided.
abstract  void transform(Envelope env)
          Transform data provided on the Envelope's context stack and place the result on the Envelope's context stack.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name_

protected java.lang.String name_
The component's name.


jumpi_

protected Jumpi jumpi_
The Jumpi instance root component.


nextTransformer_

protected Transformer nextTransformer_
The next Transformer to call once the own transformation is performed.


warnOnMismatch_

protected boolean warnOnMismatch_
Whether to warn if the transformation input conditions are not met.


exceptionOnMismatch_

protected boolean exceptionOnMismatch_
Whether to throw an Exception if the transformation input conditions are not met.

Constructor Detail

AbstractTransformer

public AbstractTransformer()
Method Detail

transform

public abstract void transform(Envelope env)
                        throws java.lang.Exception
Transform data provided on the Envelope's context stack and place the result on the Envelope's context stack.

Specified by:
transform in interface Transformer
Parameters:
env - The Envelope who's context stack data is to be transformed.
Throws:
java.lang.Exception - if any failure condition ocured. The Envelope's context stack is undefined afterwards.

configure

public void configure(java.lang.String name,
                      Properties props)
               throws java.lang.Exception

Configure the AbstractTransformer instance.

The following configuration attributes are defined.

Component name suffixes are appended onto the instance's fully qualified instance name. The child component's fully qualified instance name suffixed with '.classname' gives the property which determines which class to load for the instance.

Specified by:
configure in interface Configurable
Parameters:
name - the fully qualified instance name.
props - the read-only properties to configure the instance with.
Throws:
java.lang.Exception - when configuration is unsuccessful.
java.lang.IllegalArgumentException - if name or props is null or invalid parameters.

getName

public java.lang.String getName()
Get the fully qualified name of the instance. Identical to the name used in configure.

Specified by:
getName in interface Configurable
Returns:
the fully qualified name of the instance.
See Also:
configure(java.lang.String, org.jumpi.spi.Properties)

manage

public void manage(Component root,
                   Component parent,
                   java.lang.String operation,
                   java.util.Hashtable parameters)
            throws java.lang.Exception
Perform a recursive management operation through the Jumpi component tree, using the parameters provided.

The following management actions are handled:

Specified by:
manage in interface Manageable
Parameters:
root - the Jumpi instance at the root of the component tree.
parent - the immediate parent of the component.
operation - the operation.
parameters - the operation parameters.
Throws:
java.lang.Exception - if any failure to perform management occurs.
java.lang.IllegalArgumentException - when parameters are missing.

doNextTransformation

protected void doNextTransformation(Envelope env)
                             throws java.lang.Exception
Pass the Envelope on to the next Transformer in the processing chain.

Parameters:
env - the Envelope containing the context stack being transformed.
Throws:
java.lang.Exception - if any failure condition occurs.

Jumpi v1.2.0

Copyright © 2003, Peter Jonathan Klauser.