|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ByteArrayTransfer net.refractions.udig.ui.AbstractStrategizedTransfer
public abstract class AbstractStrategizedTransfer
This class provides the framework for a transfer to have different behaviours depending on the strategy that is set.
For example:
A GeometryTextTransfer can encode the geometry as a GML string or a WKT string (as created by JTS WKTWriter). The GeometryTextTransfer class subclasses AbstractStrategizedTransfer and only needs to provide the current strategy and the set of possible strategies. The AbstractStrategizedTransfer will first try to use the current strategy for encoding the geometry then all the rest if the current strategy fails. Similarly for decoding an input(nativeToJava) the current strategy will be tried first then the rest of the known strategies will be used until an object is obtained.
net.refractions.udig.internal.ui.TransferStrategy
Constructor Summary | |
---|---|
AbstractStrategizedTransfer()
|
Method Summary | |
---|---|
void |
addStrategy(TransferStrategy newStrategy)
Adds a new strategy the list of known strategies. |
abstract TransferStrategy[] |
getAllStrategies()
This method is only called once during construction to get the list of strategies known by the implementation. |
TransferStrategy |
getCurrentStrategy()
Returns the current strategy as indicated by the pereferences |
abstract TransferStrategy |
getDefaultStrategy()
Returns the default strategy that is used to encode the java objects. |
abstract java.lang.String[] |
getStrategyNames()
Returns the names for the strategies returned by getAllStrategies() . |
abstract java.lang.String |
getTransferName()
Returns a name for the Transfer. |
void |
javaToNative(java.lang.Object object,
TransferData transferData)
|
java.lang.Object |
nativeToJava(TransferData transferData)
|
abstract boolean |
validate(java.lang.Object object)
Returns true if the transfer can transfer to and from the object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractStrategizedTransfer()
Method Detail |
---|
public void javaToNative(java.lang.Object object, TransferData transferData)
public java.lang.Object nativeToJava(TransferData transferData)
public TransferStrategy getCurrentStrategy()
public abstract TransferStrategy getDefaultStrategy()
public abstract TransferStrategy[] getAllStrategies()
public abstract java.lang.String[] getStrategyNames()
getAllStrategies()
. The ith name
must correspond to the ith strategy.
getAllStrategies()
public abstract boolean validate(java.lang.Object object)
public void addStrategy(TransferStrategy newStrategy)
public abstract java.lang.String getTransferName()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |