org.objectweb.kilim.description
Class TpMethod

java.lang.Object
  extended byorg.objectweb.kilim.description.TemplateElementImpl
      extended byorg.objectweb.kilim.description.InlinedElement
          extended byorg.objectweb.kilim.description.TpMethod
All Implemented Interfaces:
BasicElement, java.lang.Cloneable, TemplateElement
Direct Known Subclasses:
TpConstructor

public class TpMethod
extends InlinedElement

Author:
horn

Field Summary
private  boolean isStatic
           
private  java.lang.String methodName
           
private  java.util.List parameters
           
private  java.lang.Object resultValue
           
private  BasicElement support
           
 
Fields inherited from class org.objectweb.kilim.description.InlinedElement
 
Fields inherited from class org.objectweb.kilim.description.TemplateElementImpl
 
Constructor Summary
TpMethod(BasicElement aSupport, java.lang.String aMethodName, boolean jStatic, boolean isP, boolean isT, TemplateDescription aTemplate)
          public constructor of a descriptor for a method used in a kilim template.
 
Method Summary
 void addParameter(Parameter aParam)
          adds a new parameter.
private  boolean checkParameterUnicity(Parameter aParam)
           
 int getKind()
          returns the element kind.
 java.lang.String getMethodName()
          returns the method name.
 Parameter getParameter(int aPosition)
          returns the parameter of a given position.
 int getParameterNumber()
          returns the parameter number.
 java.util.Iterator getParameters()
          returns as an iterator the parameters of the method.
 BasicElement getSupport()
           
 void insertParameter(Parameter aParam, int position)
          inserts a parameter at a given position.
 boolean isStatic()
          ,
 void isStatic(boolean jStatic)
           
 void removeParameter(Parameter aParam)
          removes a parameter.
 void setMethodName(java.lang.String aMethodName)
          sets the method name.
 void setSupport(BasicElement aSupport)
          sets the support of the method i.e.
 
Methods inherited from class org.objectweb.kilim.description.InlinedElement
getLocalName, getStatus, isEventSource, performsAction, providesValue, setLocalName, setStatus
 
Methods inherited from class org.objectweb.kilim.description.TemplateElementImpl
clone, getContainingTemplate, getTemplateDefHierarchy, setContainingTemplate
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.objectweb.kilim.description.TemplateElement
clone, getContainingTemplate, getTemplateDefHierarchy, setContainingTemplate
 

Field Detail

support

private BasicElement support

methodName

private java.lang.String methodName

isStatic

private boolean isStatic

parameters

private java.util.List parameters

resultValue

private java.lang.Object resultValue
Constructor Detail

TpMethod

public TpMethod(BasicElement aSupport,
                java.lang.String aMethodName,
                boolean jStatic,
                boolean isP,
                boolean isT,
                TemplateDescription aTemplate)
         throws KilimException
public constructor of a descriptor for a method used in a kilim template.

Parameters:
aSupport - : the element on which the method will be invoked.
aMethodName - : the name of the method.
jStatic - : true if the method is static.
isP - : true if the method can be used as a provider.
isT - : true if the method can be used as a transformer.
aTemplate - : the template in which the method is declared.
Throws:
KilimException - : generated if aSupport, aMethodName or aTemplate is null.
Method Detail

getKind

public int getKind()
Description copied from interface: BasicElement
returns the element kind.

Returns:
int
See Also:
BasicElement.getKind()

isStatic

public boolean isStatic()
,

See Also:
org.objectweb.kilim.description.libs.MethodAction#isStatic()

isStatic

public void isStatic(boolean jStatic)
              throws KilimException
Throws:
KilimException
See Also:
org.objectweb.kilim.description.libs.FieldAction#isStatic(boolean)

getSupport

public BasicElement getSupport()
See Also:
org.objectweb.kilim.description.libs.MethodAction#getSupport()

setSupport

public void setSupport(BasicElement aSupport)
                throws KilimException
sets the support of the method i.e. the object on which the method will be invoked.

Parameters:
aSupport - : the element to be used as a support.
Throws:
KilimException - ; generated if aSupport is null

getMethodName

public java.lang.String getMethodName()
returns the method name.

Returns:
String

setMethodName

public void setMethodName(java.lang.String aMethodName)
                   throws KilimException
sets the method name.

Returns:
String
Throws:
KilimException

getParameterNumber

public int getParameterNumber()
returns the parameter number.

Returns:
int

addParameter

public void addParameter(Parameter aParam)
                  throws KilimException
adds a new parameter.

Parameters:
aParam - : the parameter to be added
Throws:
KilimException - : generated if aParam is null or if if its name clashes with an existing one.

insertParameter

public void insertParameter(Parameter aParam,
                            int position)
                     throws KilimException
inserts a parameter at a given position.

Parameters:
aParam - : the parameter to be inserted.
position - : the position
Throws:
KilimException - : generated if aParam is null, if its name clashes with existing parameters

removeParameter

public void removeParameter(Parameter aParam)
                     throws KilimException
removes a parameter.

Parameters:
aParam - : the parameter to be removed.
Throws:
KilimException - : generated if aParam is null or is unknown

getParameter

public Parameter getParameter(int aPosition)
                       throws KilimException
returns the parameter of a given position.

Parameters:
aPosition - : the position
Returns:
Parameter
Throws:
KilimException - : generated if the position has an illegal value.

getParameters

public java.util.Iterator getParameters()
returns as an iterator the parameters of the method.

Returns:
Iterator

checkParameterUnicity

private boolean checkParameterUnicity(Parameter aParam)
                               throws KilimException
Throws:
KilimException