Package adams.core.optiontransfer
Class AbstractOptionTransfer
- java.lang.Object
-
- adams.core.optiontransfer.AbstractOptionTransfer
-
- Direct Known Subclasses:
ActorTransfer
,ArrayProviderTransfer
,AtomicExecutionTransfer
,AutomatableInteractiveActorTransfer
,BooleanConditionTransfer
,CallableToCopyCallableTransfer
,CopyCallableToCallableTransfer
,DirectoryListerToFileSystemSearchTransfer
,EnterValueToEnterManyValuesTransfer
,ExternalActorHandlerTransfer
,ExternalToIncludeExternalTransfer
,FileSupplierToSelectFileTransfer
,ForLoopToStorageForLoopTransfer
,IncludeExternalToExternalTransfer
,InteractiveActorTransfer
,LocalScopeHandlerTransfer
,LoggingLevelHandlerTransfer
,OptionalPasswordPromptTransfer
,RemoteExecutionHandlerTransfer
,RestorableActorTransfer
,SelectDirectoryToEnterManyValuesTransfer
,SelectFileToEnterManyValuesTransfer
,SelectFileToFileSupplierTransfer
,SetVariableTransfer
,StorageNameTransfer
,TimedActorTransfer
,VariableMonitorTransfer
public abstract class AbstractOptionTransfer extends Object
Ancestor for transferring options between option handlers.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
-
-
Field Summary
Fields Modifier and Type Field Description protected static List<AbstractOptionTransfer>
m_Transfers
the cache of transfer handlers.
-
Constructor Summary
Constructors Constructor Description AbstractOptionTransfer()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected String
check(Object source, Object target)
Hook method for checks.protected abstract String
doTransfer(Object source, Object target)
Does the actual transfer of options.static List<AbstractOptionTransfer>
getTransfers(Object source, Object target)
Returns all the transfer schemes that can handle the provided source/target.abstract boolean
handles(Object source, Object target)
Returns whether it can handle the transfer.String
transfer(Object source, Object target)
Transfers the options.protected void
transferVariable(OptionHandler source, OptionHandler target, String property)
Transfers the variable (if any attached).protected void
transferVariable(OptionHandler source, String sourceProperty, OptionHandler target, String targetProperty)
Transfers the variable (if any attached) form one property to another.
-
-
-
Field Detail
-
m_Transfers
protected static List<AbstractOptionTransfer> m_Transfers
the cache of transfer handlers.
-
-
Method Detail
-
handles
public abstract boolean handles(Object source, Object target)
Returns whether it can handle the transfer.- Parameters:
source
- the source objecttarget
- 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 objecttarget
- 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 variabletarget
- the target to receive the variableproperty
- 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 variablesourceProperty
- the source property for which to transfer the variabletarget
- the target to receive the variabletargetProperty
- 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 objecttarget
- 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 objecttarget
- 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 handletarget
- the target object to handle
-
-