org.eclipse.jst.j2ee.ejb
Interface MethodElement

All Superinterfaces:
J2EEEObject
All Known Subinterfaces:
QueryMethod

public interface MethodElement
extends J2EEEObject

The method element is used to denote a method of an enterprise bean's home or remote interface, or a set of methods. The ejb-name element must be the name of one of the enterprise beans in declared in the deployment descriptor; the optional method-intf element allows to distinguish between a method with the same signature that is defined in both the home and remote interface; the method-name element specifies the method name; and the optional method-params elements identify a single method among multiple methods with an overloaded method name. There are three possible styles of the method element syntax: 1. EJBNAME * This style is used to refer to all the methods of the specified enterprise bean's home and remote interfaces. 2. EJBNAME METHOD > This style is used to refer to the specified method of the specified enterprise bean. If there are multiple methods with the same overloaded name, the element of this style refers to all the methods with the overloaded name. 3. EJBNAME METHOD PARAM-1 PARAM-2 ... PARAM-n This style is used to refer to a single method within a set of methods with an overloaded name. PARAM-1 through PARAM-n are the fully-qualified Java types of the method's input parameters (if the method has no input arguments, the method-params element contains no method-param elements). Arrays are specified by the array element's type, followed by one or more pair of square brackets (e.g. int[][]). Used in: method-permission and container-transaction Examples: Style 1: The following method element refers to all the methods of the EmployeeService bean's home and remote interfaces: EmployeeService * Style 2: The following method element refers to all the create methods of the EmployeeService bean's home interface: EmployeeService create Style 3: The following method element refers to the create(String firstName, String LastName) method of the EmployeeService bean's home interface. EmployeeService create java.lang.String java.lang.String The following example illustrates a Style 3 element with more complex parameter types. The method foobar(char s, int i, int[] iar, mypackage.MyClass mycl, mypackage.MyClass[][] myclaar) would be specified as: EmployeeService foobar char int int[] mypackage.MyClass mypackage.MyClass[][] The optional method-intf element can be used when it becomes necessary to differentiate between a method defined in the home interface and a method with the same name and signature that is defined in the remote interface. For example, the method element EmployeeService Remote create java.lang.String java.lang.String can be used to differentiate the create(String, String) method defined in the remote interface from the create(String, String) method defined in the home interface, which would be defined as EmployeeService Home create java.lang.String java.lang.String

Since:
1.0

Field Summary
static java.lang.String COMMA
           
static java.lang.String LEFT_PAREN
           
static java.lang.String RIGHT_PAREN
           
 
Method Summary
 void addMethodParams(java.lang.String param)
           
 void applyZeroParams()
          Set the params for this method element to an empty array, as opposed to null.
 boolean equalSignature(MethodElement anotherMethodElement)
          Return true if this MethodElement and @anotherMethodElement have the same name, parameters, and type.
 java.lang.String getDescription()
           
 EList getDescriptions()
          Returns the value of the 'Descriptions' containment reference list.
 EnterpriseBean getEnterpriseBean()
           
 java.util.List getMethodParams()
           
 Method[] getMethods()
          Answer a list of all the methods for which this method element applies.
 MethodElement getMostSpecific(MethodElement aMethodElement, JavaClass aJavaClass)
          Return the MethodElement that is most specific.
 java.lang.String getName()
           
 java.lang.String getParms()
           
 java.lang.String getSignature()
          Return the signature.
 MethodElementKind getType()
           
 JavaClass getTypeJavaClass()
          Return the type cast to a JavaClass.
 boolean hasMethodParams()
           
 void initializeFromSignature(java.lang.String aSignature)
          Parse @aSignature setting the name and the params.
 boolean isDefault()
           
 boolean isEquivalent(MethodElement anotherMethodElement)
          Return true if this MethodElement and @anotherMethodElement represent the same exact methods.
 boolean isHome()
           
 boolean isLocal()
           
 boolean isLocalHome()
           
 boolean isRemote()
           
 boolean isSetType()
          Returns whether the value of the 'Type' attribute is set
 boolean isUnspecified()
           
 boolean isValid()
          Return true if this MethodElement represents one or more methods.
 boolean nameAndParamsEquals(Method aMethod)
          Return true if this MethodElement has the same basic signature as
 void removeMethodParams(java.lang.String param)
           
 boolean represents(Method aMethod)
           
 void setDescription(java.lang.String value)
           
 void setEnterpriseBean(EnterpriseBean value)
           
 void setIdToReadableString()
           
 void setName(java.lang.String value)
           
 void setParms(java.lang.String value)
           
 void setType(MethodElementKind value)
          Sets the value of the 'Type' attribute
 boolean uniquelyIdentifies(Method aMethod)
          Return true if this MethodElement uniquely identifies
 void unsetType()
          Unsets the value of the 'Type' attribute
 

Field Detail

RIGHT_PAREN

public static final java.lang.String RIGHT_PAREN
See Also:
Constant Field Values

LEFT_PAREN

public static final java.lang.String LEFT_PAREN
See Also:
Constant Field Values

COMMA

public static final java.lang.String COMMA
See Also:
Constant Field Values
Method Detail

addMethodParams

public void addMethodParams(java.lang.String param)

applyZeroParams

public void applyZeroParams()
Set the params for this method element to an empty array, as opposed to null.


equalSignature

public boolean equalSignature(MethodElement anotherMethodElement)
Return true if this MethodElement and @anotherMethodElement have the same name, parameters, and type.


getMethodParams

public java.util.List getMethodParams()

getMethods

public Method[] getMethods()
Answer a list of all the methods for which this method element applies. The following rules are used: 1) If the method element type is unspecified, the methods are obtained from the remote interface of the ejb; If it is specified, then the appropriate interface is used 2) If the method name = "*", then all the PUBLIC methods for that interface are returned 3) If the method name is specified, and no method params are specified, then all public methods for the interface having the same name are returned. 4) If the method name and params are specified, then a zero or one element array is returned, containing the one and only method on the interface with the appropriate signature, if it exists


getMostSpecific

public MethodElement getMostSpecific(MethodElement aMethodElement,
                                     JavaClass aJavaClass)
Return the MethodElement that is most specific.


getSignature

public java.lang.String getSignature()
Return the signature. For example: setTwoParamMethod(java.lang.String, java.lang.String)


getTypeJavaClass

public JavaClass getTypeJavaClass()
Return the type cast to a JavaClass.


hasMethodParams

public boolean hasMethodParams()

initializeFromSignature

public void initializeFromSignature(java.lang.String aSignature)
Parse @aSignature setting the name and the params. A signature example: setTwoParamMethod(java.lang.String, java.lang.String)


isDefault

public boolean isDefault()

isEquivalent

public boolean isEquivalent(MethodElement anotherMethodElement)
Return true if this MethodElement and @anotherMethodElement represent the same exact methods.


isHome

public boolean isHome()

isRemote

public boolean isRemote()

isUnspecified

public boolean isUnspecified()

isLocalHome

public boolean isLocalHome()

isLocal

public boolean isLocal()

isValid

public boolean isValid()
Return true if this MethodElement represents one or more methods.


nameAndParamsEquals

public boolean nameAndParamsEquals(Method aMethod)
Return true if this MethodElement has the same basic signature as


removeMethodParams

public void removeMethodParams(java.lang.String param)

represents

public boolean represents(Method aMethod)

setIdToReadableString

public void setIdToReadableString()

uniquelyIdentifies

public boolean uniquelyIdentifies(Method aMethod)
Return true if this MethodElement uniquely identifies


getName

public java.lang.String getName()
Returns:
The value of the Name attribute The method-name element contains a name of an enterprise bean method, or the asterisk (*) character. The asterisk is used when the element denotes all the methods of an enterprise bean's remote and home interfaces.

setName

public void setName(java.lang.String value)
Parameters:
value - The new value of the Name attribute

getParms

public java.lang.String getParms()
Returns:
The value of the Parms attribute The method-params element contains a list of the fully-qualified Java type names of the method parameters. In the current implementation this is a space delimitted String. A null string indicates a generic method element that can apply to multiple methods with the same name. An empty string indicates a method with zero parameters.

setParms

public void setParms(java.lang.String value)
Parameters:
value - The new value of the Parms attribute

getType

public MethodElementKind getType()
Returns:
The value of the Type attribute

setType

public void setType(MethodElementKind value)
Sets the value of the 'Type' attribute.

Parameters:
value - the new value of the 'Type' attribute.
See Also:
MethodElementKind, isSetType(), unsetType(), getType()

unsetType

public void unsetType()
Unsets the value of the 'Type' attribute.

See Also:
isSetType(), getType(), setType(MethodElementKind)

isSetType

public boolean isSetType()
Returns whether the value of the 'Type' attribute is set.

Returns:
whether the value of the 'Type' attribute is set.
See Also:
unsetType(), getType(), setType(MethodElementKind)

getDescription

public java.lang.String getDescription()
Returns:
The value of the Description attribute The description element is used by the ejb-jar file producer to provide text describing the parent element. The description element should include any information that the ejb-jar file producer wants to provide to the consumer of the ejb-jar file (i.e. to the Deployer). Typically, the tools used by the ejb-jar file consumer will display the description when processing the parent element.

setDescription

public void setDescription(java.lang.String value)
Parameters:
value - The new value of the Description attribute

getEnterpriseBean

public EnterpriseBean getEnterpriseBean()
Returns:
The EnterpriseBean reference

setEnterpriseBean

public void setEnterpriseBean(EnterpriseBean value)

getDescriptions

public EList getDescriptions()
Returns the value of the 'Descriptions' containment reference list. The list contents are of type Description.

If the meaning of the 'Descriptions' containment reference list isn't clear, there really should be more of a description here...

Returns:
the value of the 'Descriptions' containment reference list.
See Also:
EjbPackage.getMethodElement_Descriptions()