Interface Extension

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean canCreate​(java.lang.Class clazz)
      Can this extension create object instance for given interface type
      java.lang.reflect.Type chooseImplementation​(java.lang.reflect.Type type)
      Choose the implementation class for interface types
      java.lang.Object create​(java.lang.Class clazz)
      Create object instance for given interface type
      Decoder createDecoder​(java.lang.String cacheKey, java.lang.reflect.Type type)
      Customize type decoding
      Encoder createEncoder​(java.lang.String cacheKey, java.lang.reflect.Type type)
      Customize type encoding
      void updateClassDescriptor​(ClassDescriptor desc)
      Update how binding is done for the class
    • Method Detail

      • chooseImplementation

        java.lang.reflect.Type chooseImplementation​(java.lang.reflect.Type type)
        Choose the implementation class for interface types
        Parameters:
        type - the type to decode to, could be class or parameterized type
        Returns:
        the implementation type to use
      • canCreate

        boolean canCreate​(java.lang.Class clazz)
        Can this extension create object instance for given interface type
        Parameters:
        clazz - the interface
        Returns:
        true if can create, false if can not
      • create

        java.lang.Object create​(java.lang.Class clazz)
        Create object instance for given interface type
        Parameters:
        clazz - the interface
        Returns:
        the object instance, throw exception if can not create
      • createDecoder

        Decoder createDecoder​(java.lang.String cacheKey,
                              java.lang.reflect.Type type)
        Customize type decoding
        Parameters:
        cacheKey - name of the decoder
        type - change how to decode the type
        Returns:
        null, if no special customization needed
      • createEncoder

        Encoder createEncoder​(java.lang.String cacheKey,
                              java.lang.reflect.Type type)
        Customize type encoding
        Parameters:
        cacheKey - name of the encoder
        type - change how to encode the type
        Returns:
        null, if not special customization needed
      • updateClassDescriptor

        void updateClassDescriptor​(ClassDescriptor desc)
        Update how binding is done for the class
        Parameters:
        desc - binding information