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 Details

    • LOCAL_RETURN

      public static final int LOCAL_RETURN
      Constant representing a local interface return type.
      See Also:
    • REMOTE_RETURN

      public static final int REMOTE_RETURN
      Constant representing a remote interface return type.
      See Also:
    • NO_RETURN

      public static final int NO_RETURN
      Constant 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

      public List<Method> 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<Method> finderList)
    • getSelectors

      public List<Method> 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<Method> selectorList)
    • getCreateMethods

      public List<Method> 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<String,Method> 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 org.glassfish.ejb.deployment.descriptor.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 value NO_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, or NO_RETURN
    • isQueryPrefetchEnabled

      public abstract boolean isQueryPrefetchEnabled(Method method)
      Returns true 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 - use getQueryString(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 - use getQueryString(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 - use getQueryString(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 - use getQueryString(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