net.sf.navel.beans
Class ProxyDescriptor

java.lang.Object
  extended by net.sf.navel.beans.ProxyDescriptor
All Implemented Interfaces:
java.io.ObjectInputValidation, java.io.Serializable

public class ProxyDescriptor
extends java.lang.Object
implements java.io.Serializable, java.io.ObjectInputValidation

Collects the introspection and reflection data for the proxy in one place, where it can be safely shared. Also tucks away the serialization problems with introspection data which is not serializable. Despite the transient members that cannot be flagged as final, this class should be considered effectively immutable.

Author:
cmdln
See Also:
Serialized Form

Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.Class<?> getPrimaryType()
           
 java.util.Map<java.lang.String,java.beans.PropertyDescriptor> getPropertyDescriptors()
           
 java.util.Set<java.lang.Class<?>> getProxiedInterfaces()
           
 int hashCode()
           
static void resetToStringTemplate()
          Restore the default format template for toString().
static void setToStringTemplate(java.lang.String toStringTemplate)
          Allows callers to specify their own template for use with String.format(String, Object...) which excepts two arguments.
 java.lang.String toString()
           
 void validateObject()
          Used during de-serialization to restore the non serializable instrospection metadata from the JavaBeans API.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

setToStringTemplate

public static void setToStringTemplate(java.lang.String toStringTemplate)
Allows callers to specify their own template for use with String.format(String, Object...) which excepts two arguments.
  1. primary type
  2. additional types, a Collection.toString() call

Parameters:
toStringTemplate - Custom format template.

resetToStringTemplate

public static void resetToStringTemplate()
Restore the default format template for toString().


getPrimaryType

public java.lang.Class<?> getPrimaryType()
Returns:
the primaryType

getProxiedInterfaces

public java.util.Set<java.lang.Class<?>> getProxiedInterfaces()
Returns:
the proxiedInterfaces

getPropertyDescriptors

public java.util.Map<java.lang.String,java.beans.PropertyDescriptor> getPropertyDescriptors()
Returns:
The PropertyDescriptor values for all of the proxy's interfaces keyed by each property's name. The map returned is not modifiable and will throw an exception if an alteration is attempted.

validateObject

public void validateObject()
                    throws java.io.InvalidObjectException
Used during de-serialization to restore the non serializable instrospection metadata from the JavaBeans API.

Specified by:
validateObject in interface java.io.ObjectInputValidation
Throws:
java.io.InvalidObjectException
See Also:
ObjectInputValidation.validateObject()

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()