Class AbstractMethodHelper
java.lang.Object
com.sun.jdo.spi.persistence.support.ejb.ejbc.AbstractMethodHelper
- Direct Known Subclasses:
MethodHelper
This is a helper class which extracts the information needed for method
code generation of the concrete bean class.
- Author:
- Rochelle Raccah
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intConstant representing a local interface return type.static final intConstant representing no return type.static final intConstant representing a remote interface return type. -
Constructor Summary
ConstructorsConstructorDescriptionAbstractMethodHelper(org.glassfish.ejb.deployment.descriptor.EjbCMPEntityDescriptor descriptor) Creates a new instance of AbstractMethodHelper -
Method Summary
Modifier and TypeMethodDescriptionprotected voidSeparate methods into categories.Gets the list of ejb create methods for this bean.protected org.glassfish.ejb.deployment.descriptor.EjbCMPEntityDescriptorGets the EjbCMPEntityDescriptor which defines the information for this bean.Gets the list of finder methods for this bean.abstract StringgetJDOFilterExpression(Method method) Gets the jdo filter expression associated with the specified method if it exists.abstract StringgetJDOOrderingSpecification(Method method) Gets the jdo ordering specification associated with the specified method if it exists.abstract StringgetJDOParameterDeclaration(Method method) Gets the jdo parameter declaration associated with the specified method if it exists.abstract StringgetJDOVariableDeclaration(Method method) Gets the jdo variables declaration associated with the specified method if it exists.Gets the name of the local home which corresponds to this bean.Gets a map of the method names for this bean.protected org.glassfish.ejb.deployment.descriptor.QueryDescriptorgetQueryDescriptor(Method method) Gets the query descriptor associated with the specified method if it exists.intgetQueryReturnType(Method method) Gets the return type associated with the specified method if it exists.getQueryString(Method method) Gets the query string associated with the specified method if it exists.Gets the name of the remote home which corresponds to this bean.Gets the list of selector methods for this bean.abstract booleanisQueryPrefetchEnabled(Method method) Returnstrueif prefetch is enabled for the specified method,falseotherwise.protected voidsetFinders(List<Method> finderList) protected voidsetSelectors(List<Method> selectorList)
-
Field Details
-
LOCAL_RETURN
public static final int LOCAL_RETURNConstant representing a local interface return type.- See Also:
-
REMOTE_RETURN
public static final int REMOTE_RETURNConstant representing a remote interface return type.- See Also:
-
NO_RETURN
public static final int NO_RETURNConstant representing no return type.- See Also:
-
-
Constructor Details
-
AbstractMethodHelper
public AbstractMethodHelper(org.glassfish.ejb.deployment.descriptor.EjbCMPEntityDescriptor descriptor) Creates a new instance of AbstractMethodHelper- Parameters:
descriptor- the EjbCMPEntityDescriptor which defines the information for this bean.
-
-
Method Details
-
getDescriptor
protected org.glassfish.ejb.deployment.descriptor.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()Separate methods into categories.Reads all known methods and sorts them by name into specific Collections for further processing.
-
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
-
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
-
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
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
Gets the name of the local home which corresponds to this bean.- Returns:
- the name of the local home class
-
getRemoteHome
Gets the name of the remote home which corresponds to this bean.- Returns:
- the name of the remote home class
-
getQueryDescriptor
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
nullfor CMP 1.1 queries.
-
getQueryString
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
Gets the return type associated with the specified method if it exists. If no corresponding query descriptor is found, the valueNO_RETURNis 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
Returnstrueif prefetch is enabled for the specified method,falseotherwise. 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
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
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
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
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
-