org.objectweb.jonas_ejb.genic
Class VcMethod

java.lang.Object
  extended byorg.objectweb.jonas_ejb.genic.VcMethod

public class VcMethod
extends java.lang.Object

This class is the "Velocity context" for a interface method or a bean method used in the Velocity Templates.

Author:
Helene Joanin (Bull) : Initial developer, Santiago Gala (sgala@hisitech.com) - 00/09/14 - Parameters can be followed by a number in the WHERE clause, Joe Gittings has proposed to code method signature for security in order to avoid same signature for inherited methods.

Method Summary
 boolean canThrowCreate()
           
 java.lang.String getActualParameters()
           
 java.lang.String getArrayObjectParameters()
          Gets an empty array if no parameters and return an array of objects of the parameters if any
 java.lang.String getCapName()
           
 java.lang.String getDefaultValue()
           
 java.lang.String getExceptionList()
           
 java.lang.String getFormalParameters()
           
 int getMethodIndex()
           
 java.lang.String getName()
           
 int getParametersNumber()
           
 java.lang.Class[] getParameterTypes()
           
 java.util.Vector getParamList()
           
 java.util.Vector getParamWhereList()
          Only for CMP1 finder methods
 org.objectweb.medor.api.Field getResFieldOfEjbql()
          Only for CMP2 finder/select methods
 java.lang.String getReturnType()
           
 java.lang.String getSecuritySignature()
           
 java.lang.String getSqlStmt()
          Only for CMP1 finder methods
 java.lang.String getTupleGetter()
          Only for CMP2 finder/select methods
 java.lang.String getTupleGetterObjectClass()
          Only for CMP2 finder/select methos
 int getTxAttribute()
           
 java.lang.String getWrapperType()
           
 boolean isCreate()
           
 boolean isEjbActivate()
           
 boolean isEjbCreate()
           
 boolean isEjbLoad()
           
 boolean isEjbPostCreate()
           
 boolean isEjbqlReturnLocalBean()
           
 boolean isEjbqlReturnRemoteBean()
           
 boolean isEjbRemove()
           
 boolean isEjbSelectCol()
           
 boolean isEjbSelectSet()
           
 boolean isEjbSelectSimple()
           
 boolean isEjbSetEntityContext()
           
 boolean isEjbStore()
           
 boolean isFinderAll()
           
 boolean isFinderByPk()
           
 boolean isFinderCol()
           
 boolean isFinderEnum()
           
 boolean isFinderSimple()
           
 boolean isRemoveHandle()
           
 boolean isRemovePk()
           
 boolean isRemoveThis()
           
 boolean isTupleGetterPrimitive()
          Only for CMP2 finder/select methods
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getDefaultValue

public java.lang.String getDefaultValue()
Returns:
the string representation of the java default value for the cmp field (ie "0 "for int, "null" for object ...)

getName

public java.lang.String getName()
Returns:
Return the name of the method

getCapName

public java.lang.String getCapName()
Returns:
Return the name of the method with the first letter capitalized

getFormalParameters

public java.lang.String getFormalParameters()
Returns:
Return the string representation of the formal parameters list (ie "int p1, String p2")

getActualParameters

public java.lang.String getActualParameters()
Returns:
Return the string representation of the actual parameters list (ie "p1, p2")

getExceptionList

public java.lang.String getExceptionList()
Returns:
Return the string representation of the exception list of the method

canThrowCreate

public boolean canThrowCreate()
Returns:
Return true if the method throws the javax.ejb.createException exception

getSecuritySignature

public java.lang.String getSecuritySignature()
Returns:
Return the string representation of the security signature of the method

getTxAttribute

public int getTxAttribute()
Returns:
Return the transactional attribute associated to the method

getReturnType

public java.lang.String getReturnType()
Returns:
Return the name of the return type of the method

getWrapperType

public java.lang.String getWrapperType()
Returns:
the string representation of the wrapper type for the field

isFinderAll

public boolean isFinderAll()
Returns:
Return false because we are not able to know if a finder method is a FinderAll method !!

isFinderByPk

public boolean isFinderByPk()
Returns:
Return true if the method is the findByPrimaryKey() method

isFinderSimple

public boolean isFinderSimple()
Returns:
Return true if the method is a finder method that returns a unique object

isFinderEnum

public boolean isFinderEnum()
Returns:
Return true if the method is a finder method that returns a Enumeration

isFinderCol

public boolean isFinderCol()
Returns:
Return true if the method is a finder method that returns a Collection

isEjbSelectSimple

public boolean isEjbSelectSimple()
Returns:
Return true if the method is an ejbSelect method that returns a unique object

isEjbSelectSet

public boolean isEjbSelectSet()
Returns:
Return true if the method is an ejbSelect method that returns a Set

isEjbSelectCol

public boolean isEjbSelectCol()
Returns:
Return true if the method is an ejbSelect method that returns a Collection

isEjbqlReturnRemoteBean

public boolean isEjbqlReturnRemoteBean()
Returns:
Return true if the method is a finder/select method that return a remote bean

isEjbqlReturnLocalBean

public boolean isEjbqlReturnLocalBean()
Returns:
Return true if the method is a finder/select method that return a local bean

isCreate

public boolean isCreate()
Returns:
Return true if the method is home.create()

isEjbCreate

public boolean isEjbCreate()
Returns:
Return true if the method is bean.ejbCreate()

isEjbPostCreate

public boolean isEjbPostCreate()
Returns:
Return true if the method is bean.ejbPostCreate()

isRemoveThis

public boolean isRemoveThis()
Returns:
Return true if the method is EJBObject.remove() method

isRemovePk

public boolean isRemovePk()
Returns:
Return true if the method is home.remove(primarykey)

isRemoveHandle

public boolean isRemoveHandle()
Returns:
Return true if the method is home.remove(handle);

isEjbRemove

public boolean isEjbRemove()
Returns:
Return true if the method is bean.ejbRemove()

isEjbLoad

public boolean isEjbLoad()
Returns:
Return true if the method is bean.ejbLoad()

isEjbStore

public boolean isEjbStore()
Returns:
Return true if the method is bean.ejbStore()

isEjbSetEntityContext

public boolean isEjbSetEntityContext()
Returns:
Return true if the method is bean.setEntityContext()

isEjbActivate

public boolean isEjbActivate()
Returns:
Return true if the method is bean.ejbActivate()

getSqlStmt

public java.lang.String getSqlStmt()
Only for CMP1 finder methods

Returns:
Return the string representation of the SQL statement associated to the method

getParameterTypes

public java.lang.Class[] getParameterTypes()
Returns:
Return the Class array of the parameters of the method

getParametersNumber

public int getParametersNumber()
Returns:
Return the number of the parameters of the method

getParamWhereList

public java.util.Vector getParamWhereList()
Only for CMP1 finder methods

Returns:
Return the VcParamWhere list of the method

getParamList

public java.util.Vector getParamList()
Returns:
Return the VcParam list of the method

getMethodIndex

public int getMethodIndex()
Returns:
Return the index of the method. This is a unique index for each method of a bean.

getResFieldOfEjbql

public org.objectweb.medor.api.Field getResFieldOfEjbql()
Only for CMP2 finder/select methods

Returns:
Return the Medor field of tuple result of an Finder/Select method

getTupleGetter

public java.lang.String getTupleGetter()
Only for CMP2 finder/select methods

Returns:
Return the Medor get method name of the tuple result of an ejbSelect method

isTupleGetterPrimitive

public boolean isTupleGetterPrimitive()
Only for CMP2 finder/select methods

Returns:
Return true is the return type of the Medor getter method of the tuple result of an ejbSelect method is a primitive type

getTupleGetterObjectClass

public java.lang.String getTupleGetterObjectClass()
Only for CMP2 finder/select methos

Returns:
Return the associated class of the Medor getter method of the tuple result of an ejbSelect method when it's a primtive type

getArrayObjectParameters

public java.lang.String getArrayObjectParameters()
Gets an empty array if no parameters and return an array of objects of the parameters if any

Returns:
array of objects

toString

public java.lang.String toString()
Returns:
Return a string representation of the VcMethod object for debug use