Class RelaxedDuckType

  • All Implemented Interfaces:
    java.lang.reflect.InvocationHandler

    public class RelaxedDuckType
    extends DuckType
    implements java.lang.reflect.InvocationHandler
    RelaxedDuckType. Implements Duck Typing for Java. ("If it walks like a duck, quacks like a duck, it..."). Essentially allows programs to treat objects from separate hierarchies as if they were designed with common interfaces as long as they adhere to common naming conventions.

    This version is the relaxed DuckType. If a method in the interface is not present on the underlying object, the proxy simply returns null.

    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.eclipse.nebula.widgets.compositetable.internal.DuckType

        DuckType.Wrapper
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.util.HashMap NULL_VALUES  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected RelaxedDuckType​(java.lang.Object object)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Object implement​(java.lang.Class interfaceToImplement, java.lang.Object object)  
      static boolean includes​(java.lang.Object object, java.lang.String method, java.lang.Class[] args)  
      java.lang.Object invoke​(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • NULL_VALUES

        private static final java.util.HashMap NULL_VALUES
    • Constructor Detail

      • RelaxedDuckType

        protected RelaxedDuckType​(java.lang.Object object)
    • Method Detail

      • implement

        public static java.lang.Object implement​(java.lang.Class interfaceToImplement,
                                                 java.lang.Object object)
      • includes

        public static boolean includes​(java.lang.Object object,
                                       java.lang.String method,
                                       java.lang.Class[] args)
      • invoke

        public java.lang.Object invoke​(java.lang.Object proxy,
                                       java.lang.reflect.Method method,
                                       java.lang.Object[] args)
                                throws java.lang.Throwable
        Specified by:
        invoke in interface java.lang.reflect.InvocationHandler
        Overrides:
        invoke in class DuckType
        Throws:
        java.lang.Throwable