Class ActualValueReflectionTypeDescriptor<T>

  • Type Parameters:
    T - the type
    All Implemented Interfaces:
    IActualValueProvider, IMetaType

    public class ActualValueReflectionTypeDescriptor<T>
    extends ReflectionTypeDescriptor<T>
    implements IActualValueProvider
    Allows the use the IActualValueProvider mechanism for reflective types. However, we need to create an instance of the reflective type in order to make the interface available. Thus, classes using this descriptor must implement a (not necessarily accessible) no-argument constructor.
    Author:
    Holger Eichelberger
    • Constructor Detail

      • ActualValueReflectionTypeDescriptor

        ActualValueReflectionTypeDescriptor​(java.lang.reflect.Constructor<T> templateCons)
                                     throws VilException
        Creates a new type descriptor.
        Parameters:
        templateCons - the template constructor
        Throws:
        VilException - if analyzing the class fails for some reason
    • Method Detail

      • determineActualValue

        public java.lang.Object determineActualValue​(java.lang.Object object)
        Description copied from interface: IActualValueProvider
        Determines a more actual value for object in the context of using it for this type. Default types implementing this interface shall not use their attributes as this method will be called via a template object.
        Specified by:
        determineActualValue in interface IActualValueProvider
        Parameters:
        object - the initial object (may be null)
        Returns:
        the actual object (may be object if no actual value is available, may be null if object was null)