Class AbstractMethodHelper
- java.lang.Object
-
- com.sun.jdo.spi.persistence.support.ejb.ejbc.AbstractMethodHelper
-
- Direct Known Subclasses:
MethodHelper
public abstract class AbstractMethodHelper extends Object
This is a helper class which extracts the information needed for method code generation of the concrete bean class.- Author:
- Rochelle Raccah
-
-
Field Summary
Fields Modifier and Type Field Description static int
LOCAL_RETURN
Constant representing a local interface return type.static int
NO_RETURN
Constant representing no return type.static int
REMOTE_RETURN
Constant representing a remote interface return type.
-
Constructor Summary
Constructors Constructor Description AbstractMethodHelper(EjbCMPEntityDescriptor descriptor)
Creates a new instance of AbstractMethodHelper
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
categorizeMethods()
Reads all known methods and sorts them by name into specific Collections for further processing.List
getCreateMethods()
Gets the list of ejb create methods for this bean.protected EjbCMPEntityDescriptor
getDescriptor()
Gets the EjbCMPEntityDescriptor which defines the information for this bean.List
getFinders()
Gets the list of finder methods for this bean.abstract String
getJDOFilterExpression(Method method)
Gets the jdo filter expression associated with the specified method if it exists.abstract String
getJDOOrderingSpecification(Method method)
Gets the jdo ordering specification associated with the specified method if it exists.abstract String
getJDOParameterDeclaration(Method method)
Gets the jdo parameter declaration associated with the specified method if it exists.abstract String
getJDOVariableDeclaration(Method method)
Gets the jdo variables declaration associated with the specified method if it exists.String
getLocalHome()
Gets the name of the local home which corresponds to this bean.Map
getMethodNames()
Gets a map of the method names for this bean.protected QueryDescriptor
getQueryDescriptor(Method method)
Gets the query descriptor associated with the specified method if it exists.int
getQueryReturnType(Method method)
Gets the return type associated with the specified method if it exists.String
getQueryString(Method method)
Gets the query string associated with the specified method if it exists.String
getRemoteHome()
Gets the name of the remote home which corresponds to this bean.List
getSelectors()
Gets the list of selector methods for this bean.abstract boolean
isQueryPrefetchEnabled(Method method)
Returnstrue
if prefetch is enabled for the specified method,false
otherwise.protected void
setFinders(List finderList)
protected void
setSelectors(List selectorList)
-
-
-
Field Detail
-
LOCAL_RETURN
public static final int LOCAL_RETURN
Constant representing a local interface return type.- See Also:
- Constant Field Values
-
REMOTE_RETURN
public static final int REMOTE_RETURN
Constant representing a remote interface return type.- See Also:
- Constant Field Values
-
NO_RETURN
public static final int NO_RETURN
Constant representing no return type.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AbstractMethodHelper
public AbstractMethodHelper(EjbCMPEntityDescriptor descriptor)
Creates a new instance of AbstractMethodHelper- Parameters:
descriptor
- the EjbCMPEntityDescriptor which defines the information for this bean.
-
-
Method Detail
-
getDescriptor
protected EjbCMPEntityDescriptor getDescriptor()
Gets the EjbCMPEntityDescriptor which defines the information for this bean.- Returns:
- the EjbCMPEntityDescriptor for the bean specified in the constructor.
-
categorizeMethods
protected void categorizeMethods()
Reads all known methods and sorts them by name into specific Collections for further processing.
-
getFinders
public List getFinders()
Gets the list of finder methods for this bean.- Returns:
- a list of java.lang.reflect.Method objects which represent the finders for this bean
-
setFinders
protected void setFinders(List finderList)
-
getSelectors
public List getSelectors()
Gets the list of selector methods for this bean.- Returns:
- a list of java.lang.reflect.Method objects which represent the selectors for this bean
-
setSelectors
protected void setSelectors(List selectorList)
-
getCreateMethods
public List getCreateMethods()
Gets the list of ejb create methods for this bean.- Returns:
- a list of java.lang.reflect.Method objects which represent the ejb create methods for this bean
-
getMethodNames
public Map getMethodNames()
Gets a map of the method names for this bean. The keys are the method names and the values are the java.lang.reflect.Method objects. These should represent all methods of this bean.- Returns:
- a map of the method names to java.lang.reflect.Method objects for this bean
-
getLocalHome
public String getLocalHome()
Gets the name of the local home which corresponds to this bean.- Returns:
- the name of the local home class
-
getRemoteHome
public String getRemoteHome()
Gets the name of the remote home which corresponds to this bean.- Returns:
- the name of the remote home class
-
getQueryDescriptor
protected QueryDescriptor getQueryDescriptor(Method method)
Gets the query descriptor associated with the specified method if it exists.- Parameters:
method
- the java.lang.reflect.Method object used to find the query string- Returns:
- a query descriptor for the specified method. Returns
null
for CMP 1.1 queries.
-
getQueryString
public String getQueryString(Method method)
Gets the query string associated with the specified method if it exists.- Parameters:
method
- the java.lang.reflect.Method object used to find the query string- Returns:
- a query string for the specified method
-
getQueryReturnType
public int getQueryReturnType(Method method)
Gets the return type associated with the specified method if it exists. If no corresponding query descriptor is found, the valueNO_RETURN
is returned.- Parameters:
method
- the java.lang.reflect.Method object used to find the query return type- Returns:
- the return type for the specified method, one of
LOCAL_RETURN
,REMOTE_RETURN
, orNO_RETURN
-
isQueryPrefetchEnabled
public abstract boolean isQueryPrefetchEnabled(Method method)
Returnstrue
if prefetch is enabled for the specified method,false
otherwise. Prefetch is enabled by default.- Parameters:
method
- the java.lang.reflect.Method object used to find the prefetch setting.- Returns:
- a boolean representing the prefetch setting
-
getJDOFilterExpression
public abstract String getJDOFilterExpression(Method method)
Gets the jdo filter expression associated with the specified method if it exists. Note that this method should only be used for CMP 1.1 - usegetQueryString(java.lang.reflect.Method)
for CMP 2.0.- Parameters:
method
- the java.lang.reflect.Method object used to find the query filter- Returns:
- the jdo filter expression
-
getJDOParameterDeclaration
public abstract String getJDOParameterDeclaration(Method method)
Gets the jdo parameter declaration associated with the specified method if it exists. Note that this method should only be used for CMP 1.1 - usegetQueryString(java.lang.reflect.Method)
for CMP 2.0.- Parameters:
method
- the java.lang.reflect.Method object used to find the parameter declaration- Returns:
- the jdo parameter declaration
-
getJDOVariableDeclaration
public abstract String getJDOVariableDeclaration(Method method)
Gets the jdo variables declaration associated with the specified method if it exists. Note that this method should only be used for CMP 1.1 - usegetQueryString(java.lang.reflect.Method)
for CMP 2.0.- Parameters:
method
- the java.lang.reflect.Method object used to find the parameter declaration- Returns:
- the jdo variables declaration
-
getJDOOrderingSpecification
public abstract String getJDOOrderingSpecification(Method method)
Gets the jdo ordering specification associated with the specified method if it exists. Note that this method should only be used for CMP 1.1 - usegetQueryString(java.lang.reflect.Method)
for CMP 2.0.- Parameters:
method
- the java.lang.reflect.Method object used to find the parameter declaration- Returns:
- the jdo ordering specification
-
-