| Modifier and Type | Field and Description |
|---|---|
| private final Object | |
| private final ConcurrentHashMap | |
| private MetaClass | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected boolean | |
| private boolean | |
| public boolean | equals(Object
the reference object with which to compare. obj)Overrides java. |
| public Object | |
| private MetaClass | |
| public int | |
| public Object | Returns: the result of the invocation by method or delegatethe proxy proxy, final Method the method method, final Object[] the arguments args)Implements java. |
| public abstract Object | Returns: the result of the invocation of the delegatethe proxy proxy, Method the method method, Object[] the arguments args)This method is called for all Methods not defined on Object. |
| public static boolean | Returns: true if the method is deemed to be a core methodthe method to check method)Checks whether a method is a core method from java.lang.Object. |
| protected boolean | |
| private MetaClass | |
| public String |
| delegate | back to summary |
|---|---|
| private final Object delegate | |
| handleCache | back to summary |
|---|---|
| private final ConcurrentHashMap<Method, Object> handleCache | |
| metaClass | back to summary |
|---|---|
| private MetaClass metaClass | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| ConversionHandler | back to summary |
|---|---|
| public ConversionHandler(Object delegate) Creates a ConversionHandler with an delegate.
| |
| checkMethod | back to summary |
|---|---|
| protected boolean checkMethod(final Method method) | |
| defaultOverridden | back to summary |
|---|---|
| private boolean defaultOverridden(final Method method) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Indicates whether some other object is "equal to" this one. The delegate is used if the class of the parameter and the current class are equal. In other cases the method will return false. The exact class is here used, if inheritance is needed, this method must be overwritten.
| |
| getDelegate | back to summary |
|---|---|
| public Object getDelegate() Returns the delegate.
| |
| getMetaClass | back to summary |
|---|---|
| private MetaClass getMetaClass(Object proxy) | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Returns a hash code value for the delegate.
| |
| invoke | back to summary |
|---|---|
| public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable Implements java. This method is a default implementation for the invoke method given in InvocationHandler. Any call to a method with a declaring class that is not Object, excluding toString() and default methods is redirected to invokeCustom. Methods like equals and hashcode are called on the class itself instead of the delegate because they are considered fundamental methods that should not be overwritten. The toString() method gets special treatment as it is deemed to be a method that you might wish to override when called from Groovy. Interface default methods from Java 8 on the other hand are considered being default implementations you don't normally want to change. So they are called directly too In many scenarios, it is better to overwrite the invokeCustom method where the core Object related methods are filtered out.
| |
| invokeCustom | back to summary |
|---|---|
| public abstract Object invokeCustom(Object proxy, Method method, Object[] args) throws Throwable This method is called for all Methods not defined on Object. The delegate should be called here.
| |
| isCoreObjectMethod | back to summary |
|---|---|
| public static boolean isCoreObjectMethod(Method method) Checks whether a method is a core method from java.lang.Object. Such methods often receive special treatment because they are deemed fundamental enough to not be tampered with.
| |
| isDefaultMethod | back to summary |
|---|---|
| protected boolean isDefaultMethod(final Method method) | |
| setMetaClass | back to summary |
|---|---|
| private MetaClass setMetaClass(MetaClass mc) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns a String version of the delegate.
| |