org.ow2.jonas.generators.genic
Class VcMethod

java.lang.Object
  extended by org.ow2.jonas.generators.genic.VcMethod

public class VcMethod
extends 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.

Field Summary
protected  EjbqlQueryTreeHolder queryTreeHolder
           
 
Method Summary
 boolean canThrowCreate()
           
 String getActualParameters()
           
 String getArrayObjectParameters()
          Gets an empty array if no parameters and return an array of objects of the parameters if any
 String getCapName()
           
 String getDefaultValue()
           
 String getExceptionList()
           
 String getFormalParameters()
           
 int getMethodIndex()
           
 String getName()
           
 int getParametersNumber()
           
 Class[] getParameterTypes()
           
 Vector getParamList()
           
 Vector getParamWhereList()
          Only for CMP1 finder methods
 org.objectweb.medor.api.Field getResFieldOfEjbql()
          Only for CMP2 finder/select methods
 String getReturnType()
           
 String getSecuritySignature()
           
 String getSqlStmt()
          Only for CMP1 finder methods
 String getTupleGetter()
          Only for CMP2 finder/select methods
 String getTupleGetterObjectClass()
          Only for CMP2 finder/select methos
 int getTxAttribute()
           
 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
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

queryTreeHolder

protected EjbqlQueryTreeHolder queryTreeHolder
Method Detail

getDefaultValue

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

getName

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

getCapName

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

getFormalParameters

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

getActualParameters

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

getExceptionList

public 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 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 String getReturnType()
Returns:
Return the name of the return type of the method

getWrapperType

public 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 String getSqlStmt()
Only for CMP1 finder methods

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

getParameterTypes

public 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 Vector getParamWhereList()
Only for CMP1 finder methods

Returns:
Return the VcParamWhere list of the method

getParamList

public 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 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 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 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 String toString()
Overrides:
toString in class Object
Returns:
Return a string representation of the VcMethod object for debug use


Copyright © 2010 OW2 Consortium. All Rights Reserved.