org.apache.myfaces.extensions.validator.core.proxy
Interface ProxyHelper

All Known Implementing Classes:
DefaultProxyHelper

public interface ProxyHelper

Pluggable helper which handles proxied instances correctly. (The default implementation supports cglib and javassist

Since:
x.x.3

Method Summary
 String getClassNameOfObject(Object proxiedObject)
          Returns the original fully qualified class-name for the given object which might be a proxied instance.
 String getNameOfClass(Class proxiedClass)
          Returns the original fully qualified class-name for the given class which might be the class of a proxied instance.
 Class getUnproxiedClass(Class currentClass)
          Returns the original class for the given class which might be the class of a proxied instance.
<T> Class<T>
getUnproxiedClass(Class currentClass, Class<T> targetType)
          In addition to ProxyHelper#getUnproxiedClass(java.lang.Class) it casts to the given type.
 boolean isProxiedClass(Class currentClass)
          Checks if the given class is a class of a proxied instance.
 boolean isProxiedObject(Object proxiedObject)
          Checks if the given instance is proxied.
 

Method Detail

getUnproxiedClass

Class getUnproxiedClass(Class currentClass)
Returns the original class for the given class which might be the class of a proxied instance.

Parameters:
currentClass - class of proxy instance or any regular class.
Returns:
the class of the original (unproxied) instance or the parameter itself

getUnproxiedClass

<T> Class<T> getUnproxiedClass(Class currentClass,
                               Class<T> targetType)
In addition to ProxyHelper#getUnproxiedClass(java.lang.Class) it casts to the given type.

Type Parameters:
T - Type declaration for generics.
Parameters:
currentClass - class of proxy instance or any regular class.
targetType - target class type
Returns:
the class of the original (unproxied) instance or the parameter itself
See Also:
getUnproxiedClass(java.lang.Class)

getNameOfClass

String getNameOfClass(Class proxiedClass)
Returns the original fully qualified class-name for the given class which might be the class of a proxied instance.

Parameters:
proxiedClass - class of proxy instance or any regular class.
Returns:
the class-name of the original (unproxied) instance or the name of the parameter itself

getClassNameOfObject

String getClassNameOfObject(Object proxiedObject)
Returns the original fully qualified class-name for the given object which might be a proxied instance.

Parameters:
proxiedObject - proxy instance or any regular object.
Returns:
the class-name of the original (unproxied) instance or the name of the parameter itself

isProxiedClass

boolean isProxiedClass(Class currentClass)
Checks if the given class is a class of a proxied instance.

Parameters:
currentClass - proxy class to check.
Returns:
true if the given class is a class of a proxied instance

isProxiedObject

boolean isProxiedObject(Object proxiedObject)
Checks if the given instance is proxied.

Parameters:
proxiedObject - object to check.
Returns:
true if the given object is a proxied instance


Copyright © 2008-2014 The Apache Software Foundation. All Rights Reserved.