org.apache.commons.betwixt.strategy
Class ClassNormalizer

java.lang.Object
  extended by org.apache.commons.betwixt.strategy.ClassNormalizer
Direct Known Subclasses:
ListedClassNormalizer

public class ClassNormalizer
extends java.lang.Object

Class normalization strategy.

The normalized Class is the Class that Betwixt should introspect. This strategy class allows the introspected Class to be varied. This implementation simply returns the Class given.

Used by Betwixt to allow superclasses or interfaces to be subsittuted before an object is introspected. This allows users to feed in logical interfaces and make Betwixt ignore properties other than those in the interface. It also allows support for Proxy's. Together, these features allow Betwixt to deal with Entity Beans properly by viewing them through their remote interfaces.

Since:
0.5
Author:
Robert Burrell Donkin

Constructor Summary
ClassNormalizer()
           
 
Method Summary
 java.lang.Class getNormalizedClass(java.lang.Object object)
          Gets the normalized class for the given Object.
 java.lang.Class normalize(java.lang.Class clazz)
          Normalize given class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassNormalizer

public ClassNormalizer()
Method Detail

getNormalizedClass

public java.lang.Class getNormalizedClass(java.lang.Object object)
Gets the normalized class for the given Object. The normalized Class is the Class that Betwixt should introspect. This strategy class allows the introspected Class to be varied.

Parameters:
object - the Object for which the normalized Class is to be returned.
Returns:
the normalized Class

normalize

public java.lang.Class normalize(java.lang.Class clazz)
Normalize given class. The normalized Class is the Class that Betwixt should introspect. This strategy class allows the introspected Class to be varied.

Parameters:
clazz - the class to normalize, not null
Returns:
this implementation the same clazz, subclasses may return any compatible class.


Copyright 2002-2008 The Apache Software Foundation. All Rights Reserved.