com.togethersoft.openapi.model.extension
Interface CopyProvider


public interface CopyProvider
extends Provider

Provider, which implements this interface must support "copy" functionality of Element

Author:
TogetherSoft

Method Summary
 booleancanCopy(Element element)
          This method is called when canCopy method of Element was invoked or
right before model is going to call copy method of provider.
 Stringcopy(Element element, Element createdElement)
          This method must copy element and produce copied element.
 booleanisApplicable(Element element)
          Call of this method is guaranteed to precede call of any other method of this provider.

Method Detail

canCopy

public boolean canCopy(Element element)
This method is called when canCopy method of Element was invoked or
right before model is going to call copy method of provider.
Provider must return true if it can copy this element.

copy

public String copy(Element element, Element createdElement)
This method must copy element and produce copied element.
It is guaranteed, that canCopy method was called before with the same element
parameter, and true was returned.
If createdElement is null, provider must return unique name of new
Element. It shouldn't try to instantiate it. If new element was already instantiated
(with the help of another provider), this element will be passed to provider as
createdElement argument. In this case provider must only participate in copying;
any returned value will be ignored.

isApplicable

public boolean isApplicable(Element element)
Call of this method is guaranteed to precede call of any other method of this provider.
Provider must return true if it supply "copy" operation for specified element.