net.m2technologies.open_arm.utilities.collections
Class ExceptionalTransformer

java.lang.Object
  extended bynet.m2technologies.open_arm.utilities.collections.ExceptionalTransformer

public abstract class ExceptionalTransformer
extends java.lang.Object

Copyright 2005 Mark Masterson

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Description: Abstract class to use the Transformer interface to handle checked exceptions. Normally, a transformation shouldn't cause any checked exceptions. Every checked exception is wrapped into a RuntimeTransformException. The user of this class has to rewrite the #basicTransform method. The usage of this class should be combined with a special #collect method to clear the checked exception or unwrap it to throw it again.

Version:
0.009
Author:
Peter Ko�ek

Constructor Summary
ExceptionalTransformer()
           
 
Method Summary
protected abstract  java.lang.Object basicTransform(java.lang.Object o)
          method to wrap any transforming code who can throw a checked exception.
 java.lang.Object transform(java.lang.Object o)
          redefine the #transform method to establish a mechanism to tunnel checked exceptions through the Commons-Collection API which doesn't know checked exceptions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExceptionalTransformer

public ExceptionalTransformer()
Method Detail

transform

public final java.lang.Object transform(java.lang.Object o)
                                 throws RuntimeTransformerException
redefine the #transform method to establish a mechanism to tunnel checked exceptions through the Commons-Collection API which doesn't know checked exceptions. The method is declared final because you should use #basicTransform now.

Throws:
RuntimeTransformerException
See Also:
org.apache.commons.collections.Transformer#transform

basicTransform

protected abstract java.lang.Object basicTransform(java.lang.Object o)
                                            throws java.lang.Exception
method to wrap any transforming code who can throw a checked exception. This method is called by the #transform method of this class, which will wrap the exception into a RuntimeTransformException

Throws:
java.lang.Exception