FileDocCategorySizeDatePackage
MethodAction.javaAPI DocGlassfish v2 API6657Fri May 04 22:34:38 BST 2007com.sun.jdo.api.persistence.enhancer.impl

MethodAction

public class MethodAction extends com.sun.jdo.api.persistence.enhancer.util.Support
MethodAction controls the annotation actions applied to a single method of a class.

Fields Summary
private final ClassAction
ca
private final ClassMethod
theMethod
private final MethodAnnotater
annotater
private final Environment
env
Constructors Summary
MethodAction(ClassAction ca, ClassMethod method, Environment env)
Constructor

        this.ca = ca;
        theMethod = method;
        this.env = env;
        annotater = new MethodAnnotater(ca, method, env);
    
Methods Summary
voidannotate()
Perform annotations

        annotater.annotateMethod();
    
voidcheck()
Examine the method to determine what actions are required

        annotater.checkMethod();
//@olsen: disabled feature
/*
        if (env.verbose()) {
            CodeAttribute codeAttr = theMethod.codeAttribute();
            if (codeAttr != null) {
                Enumeration e = codeAttr.attributes().elements();
                while (e.hasMoreElements()) {
                    ClassAttribute attr = (ClassAttribute) e.nextElement();
                    if ((attr instanceof GenericAttribute) &&
                        safeGenericAttributes.contains(attr.attrName().asString())) {
                        String userClass = ca.classControl().userClassName();
                        String msg = "method "  + userClass +
                            "." + theMethod.name().asString() +
                            Descriptor.userMethodArgs(theMethod.signature().asString()) +
                            " contains an unrecognized attribute of type " +
                            attr.attrName().asString() + ".  " +
                            "Please check with Object Design support to see " +
                            "whether this is a problem.";
                        env.warning(msg, userClass);
                    }
                }
            }
        }
*/
    
ClassMethodmethod()
Returns the method for which this MethodAction applies

        return theMethod;
    
booleanneedsAnnotation()
Returns true if any code annotations need to be performed on this method.

        return annotater.needsAnnotation();