org.eclipse.tigerstripe.model
Interface IMethod

All Superinterfaces:
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.
 
Field Summary
 
Fields inherited from interface org.eclipse.tigerstripe.model.IModelComponent
VISIBILITY_PACKAGE, VISIBILITY_PRIVATE, VISIBILITY_PROTECTED, VISIBILITY_PUBLIC
 
Method Summary
 void addIArgument(IMethod.IArgument argument)
           
 void addIException(IMethod.IException exception)
           
 void addReturnStereotypeInstance(IStereotypeInstance instance)
           
 IMethod clone()
           
 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
 IMethod.IArgument[] getIArguments()
          Returns an array of all of the arguments for this Method.
 IMethod.IException[] getIExceptions()
          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 getMethodId()
          Returns an identifier that uniquely identifies this method within the scope of its artifact.
 java.lang.String getMethodReturnName()
          Returns the name of the return for this method.
 java.util.Properties getOssjMethodProperties()
          Deprecated. Do not use. Use getEntityMethodFlavorDetails instead.
 IType getReturnIType()
          Returns the return type 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[] getReturnStereotypeInstances()
          Returns all the stereotype instances for this
 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.
 ISessionArtifact.IEntityMethodFlavorDetails makeEntityMethodFlavorDetails()
          Factory method for OSSJ Entity Details.
 IMethod.IArgument makeIArgument()
           
 IMethod.IException makeIException()
           
 IType makeIType()
          Factory method for IType
 void removeIArguments(IMethod.IArgument[] arguments)
           
 void removeIExceptions(IMethod.IException[] exception)
           
 void removeReturnStereotypeInstance(IStereotypeInstance instance)
           
 void removeReturnStereotypeInstances(IStereotypeInstance[] instances)
           
 void setAbstract(boolean isAbstract)
          sets whether this method is abstract or not
 void setDefaultReturnValue(java.lang.String defaultReturnValue)
           
 void setEntityMethodFlavorDetails(IMethod.OssjEntityMethodFlavor flavor, ISessionArtifact.IEntityMethodFlavorDetails details)
          Sets the OSSJ Entity flavor details for this method.
 void setIArguments(IMethod.IArgument[] arguments)
           
 void setIExceptions(IMethod.IException[] exceptions)
           
 void setInstanceMethod(boolean instance)
          Sets the "InstanceMethod" flag.
 void setIteratorReturn(boolean iterate)
           
 void setMethodReturnName(java.lang.String methodReturnName)
          Sets the name of the return for this method.
 void setOptional(boolean optional)
           
 void setOrdered(boolean isOrdered)
           
 void setOssjMethodProperties(java.util.Properties prop)
          Deprecated. DO NOT USE. Please use setOssjEntityMethodFlavorDetails instead.
 void setReturnIType(IType returnType)
          Sets the return type for this Method.
 void setReturnRefBy(int refBy)
           
 void setUnique(boolean isUnique)
           
 void setVoid(boolean isVoid)
          Sets the return type to void
 java.util.List<org.eclipse.tigerstripe.internal.api.utils.TigerstripeError> validate()
           
 
Methods inherited from interface org.eclipse.tigerstripe.model.IModelComponent
addStereotypeInstance, getComment, getName, getVisibility, isInActiveFacet, removeStereotypeInstance, removeStereotypeInstances, setComment, setName, setVisibility
 
Methods inherited from interface org.eclipse.tigerstripe.profile.stereotype.IStereotypeCapable
getStereotypeInstances
 

Method Detail

makeIException

IMethod.IException makeIException()

setIExceptions

void setIExceptions(IMethod.IException[] exceptions)

addIException

void addIException(IMethod.IException exception)

removeIExceptions

void removeIExceptions(IMethod.IException[] exception)

setVoid

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


setIteratorReturn

void setIteratorReturn(boolean iterate)

makeIType

IType makeIType()
Factory method for IType

Returns:

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.

Returns:

setReturnRefBy

void setReturnRefBy(int refBy)

setReturnIType

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

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

makeIArgument

IMethod.IArgument makeIArgument()

setIArguments

void setIArguments(IMethod.IArgument[] arguments)

addIArgument

void addIArgument(IMethod.IArgument argument)

removeIArguments

void removeIArguments(IMethod.IArgument[] arguments)

setOptional

void setOptional(boolean optional)

setOssjMethodProperties

@Deprecated
void setOssjMethodProperties(java.util.Properties prop)
Deprecated. DO NOT USE. Please use setOssjEntityMethodFlavorDetails instead.

Parameters:
prop - - the internal representation for the flavor details.

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 -

validate

java.util.List<org.eclipse.tigerstripe.internal.api.utils.TigerstripeError> validate()

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

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:

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

getOssjMethodProperties

@Deprecated
java.util.Properties getOssjMethodProperties()
Deprecated. Do not use. Use getEntityMethodFlavorDetails instead.

Returns:
internal representation for OSSJ method flavor details.

setUnique

void setUnique(boolean isUnique)

setOrdered

void setOrdered(boolean 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

setDefaultReturnValue

void setDefaultReturnValue(java.lang.String defaultReturnValue)

setMethodReturnName

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


getReturnStereotypeInstances

IStereotypeInstance[] getReturnStereotypeInstances()
Returns all the stereotype instances for this

Returns:

addReturnStereotypeInstance

void addReturnStereotypeInstance(IStereotypeInstance instance)

removeReturnStereotypeInstance

void removeReturnStereotypeInstance(IStereotypeInstance instance)

removeReturnStereotypeInstances

void removeReturnStereotypeInstances(IStereotypeInstance[] instances)

clone

IMethod clone()

getContainingArtifact

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

Returns:
the containing artifact.

getDefaultReturnValue

java.lang.String getDefaultReturnValue()
Returns the default return value for this method is it has been defined, null otherwise

Returns:

getIArguments

IMethod.IArgument[] getIArguments()
Returns an array of all of the arguments for this Method. Returns an empty array if no arguments are defined.

Returns:
IArgument[] - array of arguments for this Method

getIExceptions

IMethod.IException[] getIExceptions()
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

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

getMethodReturnName

java.lang.String getMethodReturnName()
Returns the name of the return for this method.

Returns:

getReturnIType

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

Returns:
IType - the type returned by this Method.

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

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

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 shoud be an iterator

isOptional

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

Returns:
boolean - true if optional

isOrdered

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

Returns:

isUnique

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

Returns:

isVoid

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

Returns:
boolean - true if void