Class AbstractOptionTransfer

    • Constructor Detail

      • AbstractOptionTransfer

        public AbstractOptionTransfer()
    • Method Detail

      • handles

        public abstract boolean handles​(Object source,
                                        Object target)
        Returns whether it can handle the transfer.
        Parameters:
        source - the source object
        target - the target object
        Returns:
        true if options can be transferred by this class
      • check

        protected String check​(Object source,
                               Object target)
        Hook method for checks.
        Parameters:
        source - the source object
        target - the target object
        Returns:
        null if successful, otherwise error message
      • transferVariable

        protected void transferVariable​(OptionHandler source,
                                        OptionHandler target,
                                        String property)
        Transfers the variable (if any attached).
        Parameters:
        source - the source from which to transfer the variable
        target - the target to receive the variable
        property - the property for which to transfer the variable
      • transferVariable

        protected void transferVariable​(OptionHandler source,
                                        String sourceProperty,
                                        OptionHandler target,
                                        String targetProperty)
        Transfers the variable (if any attached) form one property to another.
        Parameters:
        source - the source from which to transfer the variable
        sourceProperty - the source property for which to transfer the variable
        target - the target to receive the variable
        targetProperty - the target property to receive the variable
      • doTransfer

        protected abstract String doTransfer​(Object source,
                                             Object target)
        Does the actual transfer of options.
        Parameters:
        source - the source object
        target - the target object
        Returns:
        null if successful, otherwise error message
      • transfer

        public String transfer​(Object source,
                               Object target)
        Transfers the options.
        Parameters:
        source - the source object
        target - the target object
        Returns:
        null if successful, otherwise error message
      • getTransfers

        public static List<AbstractOptionTransfer> getTransfers​(Object source,
                                                                Object target)
        Returns all the transfer schemes that can handle the provided source/target.
        Parameters:
        source - the source object to handle
        target - the target object to handle