public static EnclosingStaticJoinPoint newEnclosingStaticJoinPoint(
final Class declaringClass,
final String name,
final String description) {
if (TransformationConstants.CLINIT_METHOD_NAME.equals(name)) {
return new EnclosingStaticJoinPointImpl(
new StaticInitializerSignatureImpl(declaringClass),
JoinPointType.STATIC_INITIALIZATION
);
} else if (TransformationConstants.INIT_METHOD_NAME.equals(name)) {
return new EnclosingStaticJoinPointImpl(
newConstructorSignature(declaringClass, AsmHelper.calculateConstructorHash(description)),
JoinPointType.CONSTRUCTOR_EXECUTION
);
} else {
// regular method
return new EnclosingStaticJoinPointImpl(
newMethodSignature(declaringClass, AsmHelper.calculateMethodHash(name, description)),
JoinPointType.METHOD_EXECUTION
);
}
}