Groovy Documentation

org.codehaus.griffon.ast
[Java] Class Perf4jAwareASTTransformation

java.lang.Object
  org.codehaus.griffon.ast.AbstractASTTransformation
      org.codehaus.griffon.ast.Perf4jAwareASTTransformation
All Implemented Interfaces:
Perf4jAwareConstants

@GroovyASTTransformation(phase = CompilePhase.CANONICALIZATION)
public class Perf4jAwareASTTransformation
extends AbstractASTTransformation

Handles generation of code for the @Perf4jAware annotation.

Authors:
Andres Almiray


Field Summary
private static ClassNode DEFAULT_PERF4j_PROVIDER_CNODE

private static String[] DELEGATING_METHODS

private static org.slf4j.Logger LOG

private static ClassNode PERF4j_AWARE_CNODE

private static ClassNode PERF4j_CONTRIBUTION_HANDLER_CNODE

private static ClassNode PERF4j_PROVIDER_CNODE

 
Fields inherited from class AbstractASTTransformation
V1_1, V1_2, V1_3, V1_4, V1_5, V1_6, V1_7, ACC_PUBLIC, ACC_PRIVATE, ACC_PROTECTED, ACC_STATIC, ACC_FINAL, ACC_SUPER, ACC_SYNCHRONIZED, ACC_VOLATILE, ACC_BRIDGE, ACC_VARARGS, ACC_TRANSIENT, ACC_NATIVE, ACC_INTERFACE, ACC_ABSTRACT, ACC_STRICT, ACC_SYNTHETIC, ACC_ANNOTATION, ACC_ENUM, ACC_DEPRECATED, T_BOOLEAN, T_CHAR, T_FLOAT, T_DOUBLE, T_BYTE, T_SHORT, T_INT, T_LONG, F_NEW, F_FULL, F_APPEND, F_CHOP, F_SAME, F_SAME1, TOP, INTEGER, FLOAT, DOUBLE, LONG, NULL, UNINITIALIZED_THIS, INVOKEDYNAMIC_OWNER, NOP, ACONST_NULL, ICONST_M1, ICONST_0, ICONST_1, ICONST_2, ICONST_3, ICONST_4, ICONST_5, LCONST_0, LCONST_1, FCONST_0, FCONST_1, FCONST_2, DCONST_0, DCONST_1, BIPUSH, SIPUSH, LDC, ILOAD, LLOAD, FLOAD, DLOAD, ALOAD, IALOAD, LALOAD, FALOAD, DALOAD, AALOAD, BALOAD, CALOAD, SALOAD, ISTORE, LSTORE, FSTORE, DSTORE, ASTORE, IASTORE, LASTORE, FASTORE, DASTORE, AASTORE, BASTORE, CASTORE, SASTORE, POP, POP2, DUP, DUP_X1, DUP_X2, DUP2, DUP2_X1, DUP2_X2, SWAP, IADD, LADD, FADD, DADD, ISUB, LSUB, FSUB, DSUB, IMUL, LMUL, FMUL, DMUL, IDIV, LDIV, FDIV, DDIV, IREM, LREM, FREM, DREM, INEG, LNEG, FNEG, DNEG, ISHL, LSHL, ISHR, LSHR, IUSHR, LUSHR, IAND, LAND, IOR, LOR, IXOR, LXOR, IINC, I2L, I2F, I2D, L2I, L2F, L2D, F2I, F2L, F2D, D2I, D2L, D2F, I2B, I2C, I2S, LCMP, FCMPL, FCMPG, DCMPL, DCMPG, IFEQ, IFNE, IFLT, IFGE, IFGT, IFLE, IF_ICMPEQ, IF_ICMPNE, IF_ICMPLT, IF_ICMPGE, IF_ICMPGT, IF_ICMPLE, IF_ACMPEQ, IF_ACMPNE, GOTO, JSR, RET, TABLESWITCH, LOOKUPSWITCH, IRETURN, LRETURN, FRETURN, DRETURN, ARETURN, RETURN, GETSTATIC, PUTSTATIC, GETFIELD, PUTFIELD, INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC, INVOKEINTERFACE, INVOKEDYNAMIC, NEW, NEWARRAY, ANEWARRAY, ARRAYLENGTH, ATHROW, CHECKCAST, INSTANCEOF, MONITORENTER, MONITOREXIT, MULTIANEWARRAY, IFNULL, IFNONNULL
 
Constructor Summary
Perf4jAwareASTTransformation()

 
Method Summary
static void addPerf4jContributionIfNeeded(SourceUnit source, ClassNode classNode)

static void apply(ClassNode declaringClass)

private static Expression defaultPerf4jProviderInstance()

static boolean hasPerf4jAwareAnnotation(AnnotatedNode node)

Convenience method to see if an annotated node is @Perf4jAware.

protected static boolean needsPerf4jContribution(ClassNode declaringClass, SourceUnit sourceUnit)

void visit(ASTNode[] nodes, SourceUnit source)

Handles the bulk of the processing, mostly delegating to other methods.

 
Methods inherited from class AbstractASTTransformation
emptyMap, addError, makeClassSafe, makeClassSafe, makeClassSafe, applicationInstance, wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll, visit
 
Methods inherited from class Object
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
 

Field Detail

DEFAULT_PERF4j_PROVIDER_CNODE

private static final ClassNode DEFAULT_PERF4j_PROVIDER_CNODE


DELEGATING_METHODS

private static final String[] DELEGATING_METHODS


LOG

private static final org.slf4j.Logger LOG


PERF4j_AWARE_CNODE

private static final ClassNode PERF4j_AWARE_CNODE


PERF4j_CONTRIBUTION_HANDLER_CNODE

private static final ClassNode PERF4j_CONTRIBUTION_HANDLER_CNODE


PERF4j_PROVIDER_CNODE

private static final ClassNode PERF4j_PROVIDER_CNODE


 
Constructor Detail

Perf4jAwareASTTransformation

Perf4jAwareASTTransformation()


 
Method Detail

addPerf4jContributionIfNeeded

public static void addPerf4jContributionIfNeeded(SourceUnit source, ClassNode classNode)


apply

public static void apply(ClassNode declaringClass)


defaultPerf4jProviderInstance

private static Expression defaultPerf4jProviderInstance()


hasPerf4jAwareAnnotation

public static boolean hasPerf4jAwareAnnotation(AnnotatedNode node)
Convenience method to see if an annotated node is @Perf4jAware.
Parameters:
node - the node to check
Returns:
true if the node is an event publisher


needsPerf4jContribution

protected static boolean needsPerf4jContribution(ClassNode declaringClass, SourceUnit sourceUnit)


visit

public void visit(ASTNode[] nodes, SourceUnit source)
Handles the bulk of the processing, mostly delegating to other methods.
Parameters:
nodes - the ast nodes
source - the source unit for the nodes


 

Groovy Documentation