COSMOS ${releaseVersion} resource-modeling Project
Internal API Specification

org.eclipse.cosmos.rm.repository.internal.operations
Class AbstractSMLOperation

java.lang.Object
  extended by org.eclipse.cosmos.rm.repository.internal.operations.AbstractListenerManager
      extended by org.eclipse.cosmos.rm.repository.internal.operations.AbstractSMLOperation
All Implemented Interfaces:
org.eclipse.cosmos.rm.repository.provisional.operations.ISMLOperation
Direct Known Subclasses:
FileExportOperation, FileImportOperation, FileValidateOpeartion

public abstract class AbstractSMLOperation
extends AbstractListenerManager
implements org.eclipse.cosmos.rm.repository.provisional.operations.ISMLOperation

An abstract class used to implement common functionality between repository operations.


Constructor Summary
AbstractSMLOperation(org.eclipse.cosmos.rm.repository.provisional.core.ISMLRepository repository)
          Constructor
 
Method Summary
 void addArgument(java.lang.Object argument)
          Adds an argument to this operation.
protected  boolean checkType(java.lang.Class expected, java.lang.Class actual)
          Checks that the expected class is equivalent to actual
protected  boolean checkType(java.lang.Object[] arguments, java.lang.Class expected)
          Checks that each argument's class is of type expected
protected  boolean checkType(java.lang.Object[] arguments, java.lang.Class[] expectedClasses)
          Checks to ensure that argument[i]'s class is equivalent to expectedClasses[i].
 java.lang.Object[] getArguments()
           
protected  org.eclipse.cosmos.rm.repository.provisional.core.ISMLRepository getRepository()
           
 void setArguments(java.lang.Object[] arguments)
          Sets the arguments of this operation.
protected  void setRepository(org.eclipse.cosmos.rm.repository.provisional.core.ISMLRepository repository)
           
 
Methods inherited from class org.eclipse.cosmos.rm.repository.internal.operations.AbstractListenerManager
addProgressListener, getProgressListeners, removeProgressListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.cosmos.rm.repository.provisional.operations.ISMLOperation
addProgressListener, getId, removeProgressListener, run
 

Constructor Detail

AbstractSMLOperation

public AbstractSMLOperation(org.eclipse.cosmos.rm.repository.provisional.core.ISMLRepository repository)
Constructor

Parameters:
expectedArgType - The expected argument type
Method Detail

setArguments

public void setArguments(java.lang.Object[] arguments)
                  throws java.lang.IllegalArgumentException
Description copied from interface: org.eclipse.cosmos.rm.repository.provisional.operations.ISMLOperation
Sets the arguments of this operation. The type of the argument is a contract between the implementation of the operation and the consuming client.

Specified by:
setArguments in interface org.eclipse.cosmos.rm.repository.provisional.operations.ISMLOperation
Parameters:
arguments - The arguments of this operation
Throws:
java.lang.IllegalArgumentException - If the argument type is not what is expected by the underlying implementation
See Also:
ISMLOperation.setArguments(java.lang.Object[])

addArgument

public void addArgument(java.lang.Object argument)
                 throws java.lang.IllegalArgumentException
Description copied from interface: org.eclipse.cosmos.rm.repository.provisional.operations.ISMLOperation
Adds an argument to this operation. The type of the argument is a contract between the implementation of the operation and the consuming client.

Specified by:
addArgument in interface org.eclipse.cosmos.rm.repository.provisional.operations.ISMLOperation
Parameters:
argument - The argument to be added
Throws:
java.lang.IllegalArgumentException - If the argument type is not what is expected by the underlying implementation
See Also:
ISMLOperation.addArgument(java.lang.Object)

getArguments

public java.lang.Object[] getArguments()

getRepository

protected org.eclipse.cosmos.rm.repository.provisional.core.ISMLRepository getRepository()
Returns:
the repository

setRepository

protected void setRepository(org.eclipse.cosmos.rm.repository.provisional.core.ISMLRepository repository)
Parameters:
repository - the repository to set

checkType

protected boolean checkType(java.lang.Class expected,
                            java.lang.Class actual)
Checks that the expected class is equivalent to actual

Parameters:
expected - The expected class name
actual - The actual class name
Returns:
true if the expected class is of type actual; false otherwise

checkType

protected boolean checkType(java.lang.Object[] arguments,
                            java.lang.Class expected)
Checks that each argument's class is of type expected

Parameters:
arguments - The arguments
expected - The expected class
Returns:
True if all argument's classes are of type expected; false otherwise

checkType

protected boolean checkType(java.lang.Object[] arguments,
                            java.lang.Class[] expectedClasses)
Checks to ensure that argument[i]'s class is equivalent to expectedClasses[i].

Returns:
true if arguments[i]'s class is equivalent to expectedClasses[i]; false otherwise.

COSMOS ${releaseVersion} resource-modeling Project
Internal API Specification