org.eclipse.tigerstripe.workbench.model.deprecated_
Interface IMethod

All Superinterfaces:
org.eclipse.tigerstripe.workbench.model.annotation.IAnnotationCapable, IModelComponent, IStereotypeCapable

public interface IMethod
extends IModelComponent


Nested Class Summary
static interface IMethod.IArgument
           
static interface IMethod.IException
           
static class IMethod.OssjEntityMethodFlavor
          This enum represents the "Flavors" that might be supported for a method.
static class IMethod.OssjMethodProperty
          This enum represents some key "Properties" of a method.
 
Nested classes/interfaces inherited from interface org.eclipse.tigerstripe.workbench.model.deprecated_.IModelComponent
IModelComponent.EMultiplicity, IModelComponent.EVisibility
 
Field Summary
static java.util.List<IMethod> EMPTY_LIST
           
 
Method Summary
 void addArgument(IMethod.IArgument argument)
          Add an argument to the method.
 void addException(IMethod.IException exception)
          Add a single Exception to the method.
 void addReturnStereotypeInstance(IStereotypeInstance instance)
          Add a single stereotype to the return type.
 IMethod clone()
          Clone this method.
 java.util.Collection<IMethod.IArgument> getArguments()
          Returns a collection of all of the arguments for this Method.
 IAbstractArtifact getContainingArtifact()
          Returns the IArtifact that is the "container" for the Method.
 java.lang.String getDefaultReturnValue()
          Returns the default return value for this method is it has been defined, null otherwise.
 ISessionArtifact.IEntityMethodFlavorDetails getEntityMethodFlavorDetails(IMethod.OssjEntityMethodFlavor flavor)
          Returns the OSSJ flavor details for this method
 java.util.Collection<IMethod.IException> getExceptions()
          Returns an array of all of the exceptions for this Method.
 java.lang.String getLabelString()
          Returns a String containing the methodName+profile&returntype.
 java.lang.String getLabelString(boolean includeArgStereotypes)
          Returns a String containing the methodName+profile&returntype.
 java.lang.String getMethodId()
          Returns an identifier that uniquely identifies this method within the scope of its artifact.
 java.lang.String getReturnName()
          Returns the name of the return for this method.
 int getReturnRefBy()
          Returns an integer value indicating the reference type of the return.
 java.lang.String getReturnRefByString()
          Returns an String value indicating the reference type of the return.
 IStereotypeInstance getReturnStereotypeInstanceByName(java.lang.String name)
          Returns the named stereotype instances for the return type of the method.
 java.util.Collection<IStereotypeInstance> getReturnStereotypeInstances()
          Returns all the stereotype instances for the return type of the method.
 IType getReturnType()
          Returns the return type for this Method.
 boolean hasReturnStereotypeInstance(java.lang.String name)
          Returns true if the method has the named return Stereotype
 boolean isAbstract()
          Returns a boolean indicating whether this method is abstract or not.
 boolean isInstanceMethod()
          Returns true if this Method is an instance method.
 boolean isIteratorReturn()
          Returns a boolean indicating whether the return for this method is an iterator or not.
 boolean isOptional()
          Returns a boolean indicating if this Method is optional or mandatory.
 boolean isOrdered()
          Returns true if the return of this method contains ordered values (multiplicity > 1)
 boolean isUnique()
          Returns true if the return of this method contains unique values (multiplicity > 1)
 boolean isVoid()
          Returns true if the return of this Method is void.
 IMethod.IArgument makeArgument()
          Make a blank Argument.
 ISessionArtifact.IEntityMethodFlavorDetails makeEntityMethodFlavorDetails()
          Factory method for OSSJ Entity Details.
 IMethod.IException makeException()
          Make a blank Exception.
 IType makeType()
          Factory method for IType
 void removeArguments(java.util.Collection<IMethod.IArgument> arguments)
          Remove arguments from the argument list.
 void removeExceptions(java.util.Collection<IMethod.IException> exception)
          Remove exceptions from the method.
 void removeReturnStereotypeInstance(IStereotypeInstance instance)
          Remove a single Stereotype instance from the method return.
 void removeReturnStereotypeInstances(java.util.Collection<IStereotypeInstance> instances)
          Remove Stereotype instances from the method return.
 void setAbstract(boolean isAbstract)
          sets whether this method is abstract or not
 void setArguments(java.util.Collection<IMethod.IArgument> arguments)
          Set the arguments for the method.
 void setDefaultReturnValue(java.lang.String defaultReturnValue)
          Sets the default return Value for this method.
 void setEntityMethodFlavorDetails(IMethod.OssjEntityMethodFlavor flavor, ISessionArtifact.IEntityMethodFlavorDetails details)
          Sets the OSSJ Entity flavor details for this method.
 void setExceptions(java.util.Collection<IMethod.IException> exceptions)
          Set the exceptions for the method.
 void setInstanceMethod(boolean instance)
          Sets the "InstanceMethod" flag.
 void setIteratorReturn(boolean iterate)
          Sets the isIterator attribute of the method.
 void setOptional(boolean optional)
          Set the optional attribute of this method.
 void setOrdered(boolean isOrdered)
          Sets the ordered attribute for this method.
 void setReturnName(java.lang.String methodReturnName)
          Sets the name of the return for this method.
 void setReturnRefBy(int refBy)
          Set the reference type of the return.
 void setReturnType(IType returnType)
          Sets the return type for this Method.
 void setUnique(boolean isUnique)
          Sets the unique attribute for this method.
 void setVoid(boolean isVoid)
          Sets the return type to void
 
Methods inherited from interface org.eclipse.tigerstripe.workbench.model.deprecated_.IModelComponent
getComment, getContainedModelComponents, getContainingModelComponent, getLabel, getMetadata, getName, getProject, getVisibility, isInActiveFacet, setComment, setName, setVisibility, validate
 
Methods inherited from interface org.eclipse.tigerstripe.workbench.profile.stereotype.IStereotypeCapable
addStereotypeInstance, getStereotypeInstanceByName, getStereotypeInstances, getStereotypeString, hasStereotypeInstance, removeStereotypeInstance, removeStereotypeInstances
 
Methods inherited from interface org.eclipse.tigerstripe.workbench.model.annotation.IAnnotationCapable
getAnnotation, getAnnotations, getAnnotations, getAnnotations, hasAnnotations, hasAnnotations, hasAnnotations
 

Field Detail

EMPTY_LIST

static final java.util.List<IMethod> EMPTY_LIST
Method Detail

getContainingArtifact

IAbstractArtifact getContainingArtifact()
Returns the IArtifact that is the "container" for the Method.

Returns:
the containing artifact.

getLabelString

java.lang.String getLabelString()
Returns a String containing the methodName+profile&returntype. This is used for display on class diagrams e.g. but also to uniquely identify a method within the context of an artifact. The format is: name(argumentList)::returnTypeName This is equivalent to getLabelString(true)

Returns:
formatted String

getLabelString

java.lang.String getLabelString(boolean includeArgStereotypes)
Returns a String containing the methodName+profile&returntype. This is used for display on class diagrams e.g. but also to uniquely identify a method within the context of an artifact. The format is: name(argumentList)::returnTypeName

Parameters:
includeArgStereotypes - - <> on args will be included if true
Returns:
formatted String

getMethodId

java.lang.String getMethodId()
Returns an identifier that uniquely identifies this method within the scope of its artifact. This id is assembled based on the signature of this method. There can't be 2 methods with the same signatureId per artifact.

Returns:
String - a unique identifier for this Method

getExceptions

java.util.Collection<IMethod.IException> getExceptions()
Returns an array of all of the exceptions for this Method. Returns an empty array if no exceptions are defined.

Returns:
IException[] - An array of all defined exceptions for this Method

addException

void addException(IMethod.IException exception)
Add a single Exception to the method.

Parameters:
exception - to add

setExceptions

void setExceptions(java.util.Collection<IMethod.IException> exceptions)
Set the exceptions for the method.

Parameters:
exceptions -

removeExceptions

void removeExceptions(java.util.Collection<IMethod.IException> exception)
Remove exceptions from the method.

Parameters:
exception -

makeException

IMethod.IException makeException()
Make a blank Exception. Note this is not added to the method.

Returns:
a new IException

getArguments

java.util.Collection<IMethod.IArgument> getArguments()
Returns a collection of all of the arguments for this Method. Returns an empty collection if no arguments are defined.

Returns:
Collection - unmodifiable collection of arguments for this Method

addArgument

void addArgument(IMethod.IArgument argument)
Add an argument to the method. The argument will be added to the end of the argument list.

Parameters:
argument -

setArguments

void setArguments(java.util.Collection<IMethod.IArgument> arguments)
Set the arguments for the method.

Parameters:
arguments -

removeArguments

void removeArguments(java.util.Collection<IMethod.IArgument> arguments)
Remove arguments from the argument list.

Parameters:
arguments -

makeArgument

IMethod.IArgument makeArgument()
Make a blank Argument. Note the argument is not added to the method.

Returns:
a new IArgument.

isVoid

boolean isVoid()
Returns true if the return of this Method is void.

Returns:
boolean - true if void

setVoid

void setVoid(boolean isVoid)
Sets the return type to void


getReturnName

java.lang.String getReturnName()
Returns the name of the return for this method. This is useful when generating XML for example where a name is required.

Returns:

setReturnName

void setReturnName(java.lang.String methodReturnName)
Sets the name of the return for this method.


getReturnType

IType getReturnType()
Returns the return type for this Method. If isVoid() the result of this method is unknown.

Returns:
IType - the type returned by this Method.

setReturnType

void setReturnType(IType returnType)
Sets the return type for this Method.

Parameters:
returnType - - the return type for this method.

makeType

IType makeType()
Factory method for IType

Returns:
a blank IType.

getDefaultReturnValue

java.lang.String getDefaultReturnValue()
Returns the default return value for this method is it has been defined, null otherwise. The string is not checked for its ability to be parsed into an object of the appropriate return type for this method.

Returns:
a string representation.

setDefaultReturnValue

void setDefaultReturnValue(java.lang.String defaultReturnValue)
Sets the default return Value for this method.

Parameters:
defaultReturnValue -

getReturnStereotypeInstances

java.util.Collection<IStereotypeInstance> getReturnStereotypeInstances()
Returns all the stereotype instances for the return type of the method.

Returns:
the stereotypes applied to the method return

hasReturnStereotypeInstance

boolean hasReturnStereotypeInstance(java.lang.String name)
Returns true if the method has the named return Stereotype

Parameters:
name -
Returns:

getReturnStereotypeInstanceByName

IStereotypeInstance getReturnStereotypeInstanceByName(java.lang.String name)
Returns the named stereotype instances for the return type of the method.

Returns:
the named stereotype applied to the method return

addReturnStereotypeInstance

void addReturnStereotypeInstance(IStereotypeInstance instance)
Add a single stereotype to the return type.

Parameters:
instance - to add.

removeReturnStereotypeInstance

void removeReturnStereotypeInstance(IStereotypeInstance instance)
Remove a single Stereotype instance from the method return.

Parameters:
instance - to remove

removeReturnStereotypeInstances

void removeReturnStereotypeInstances(java.util.Collection<IStereotypeInstance> instances)
Remove Stereotype instances from the method return.

Parameters:
instances - to remove

isOptional

boolean isOptional()
Returns a boolean indicating if this Method is optional or mandatory.

Returns:
boolean - true if optional

setOptional

void setOptional(boolean optional)
Set the optional attribute of this method.

Parameters:
optional -

isUnique

boolean isUnique()
Returns true if the return of this method contains unique values (multiplicity > 1)

Returns:

setUnique

void setUnique(boolean isUnique)
Sets the unique attribute for this method.

Parameters:
isUnique -

isOrdered

boolean isOrdered()
Returns true if the return of this method contains ordered values (multiplicity > 1)

Returns:

setOrdered

void setOrdered(boolean isOrdered)
Sets the ordered attribute for this method.

Parameters:
isOrdered -

isAbstract

boolean isAbstract()
Returns a boolean indicating whether this method is abstract or not.

Returns:
boolean - true if this method is abstract, false otherwise

setAbstract

void setAbstract(boolean isAbstract)
sets whether this method is abstract or not

Parameters:
isAbstract - - boolean, true to set this method as abstract

clone

IMethod clone()
Clone this method.

Returns:

getReturnRefBy

int getReturnRefBy()
Returns an integer value indicating the reference type of the return. Possible values are defined in the static fields of IField.

Returns:
int - the integer value corresponding to the refBy

setReturnRefBy

void setReturnRefBy(int refBy)
Set the reference type of the return. Possible values are defined in the static fields of IField.

Parameters:
refBy -

getReturnRefByString

java.lang.String getReturnRefByString()
Returns an String value indicating the reference type of the return. Possible values are defined in the refByLabels field of IField.

Returns:
String - the refBy type

setInstanceMethod

void setInstanceMethod(boolean instance)
Sets the "InstanceMethod" flag. This is only applicable to Entity methods. By default an entity method is an instanceMethod (i.e. it is exposed on a JVTSession that manages that entity type). When not an instanceMethod, the method is instead exposed on the managed entity value directly, without any transformation. In that case no variation is available (byKey, byTemplates, etc...)

Parameters:
instance -

isInstanceMethod

boolean isInstanceMethod()
Returns true if this Method is an instance method.

Returns:
boolean - true if this Method is an instance method

isIteratorReturn

boolean isIteratorReturn()
Returns a boolean indicating whether the return for this method is an iterator or not.

Returns:
boolean - true if this method return type should be an iterator

setIteratorReturn

void setIteratorReturn(boolean iterate)
Sets the isIterator attribute of the method.

Parameters:
iterate -

getEntityMethodFlavorDetails

ISessionArtifact.IEntityMethodFlavorDetails getEntityMethodFlavorDetails(IMethod.OssjEntityMethodFlavor flavor)
                                                                         throws TigerstripeException
Returns the OSSJ flavor details for this method

Parameters:
flavor - - OssjEntityMethodFlavor target flavor
Returns:
OSSJ flavor details for this method
Throws:
TigerstripeException, - if method doesn't belong to Managed Entity
TigerstripeException

setEntityMethodFlavorDetails

void setEntityMethodFlavorDetails(IMethod.OssjEntityMethodFlavor flavor,
                                  ISessionArtifact.IEntityMethodFlavorDetails details)
                                  throws TigerstripeException
Sets the OSSJ Entity flavor details for this method.

Parameters:
flavor - - the target flavor
details - - the details for this target flavor
Throws:
TigerstripeException - - if this method doesn't belong to a ManagedEntity

makeEntityMethodFlavorDetails

ISessionArtifact.IEntityMethodFlavorDetails makeEntityMethodFlavorDetails()
Factory method for OSSJ Entity Details. The returned entity details is the default details for the given flavor for a method.

Returns: