ReflectionInfo reflectInfo = context.getWithinReflectionInfo();
if(node.isStaticInitializer()) {
if(reflectInfo instanceof StaticInitializationInfo) {
// Ignore the ASTStaticInitialization node in this context
SimpleNode staticClinitNode = (SimpleNode) node.jjtGetChild(0);
ClassInfo declaringClassInfo = ((StaticInitializationInfo) reflectInfo).getDeclaringType();
boolean matchedAnnotations = visitAttributes(staticClinitNode, declaringClassInfo);
if(!matchedAnnotations) {
return Boolean.FALSE;
}
// In an annotated subtree, the last child node represents the pattern
Node lastNode = staticClinitNode.jjtGetChild(staticClinitNode.jjtGetNumChildren() - 1);
if(lastNode instanceof ASTAttribute) {
return Boolean.TRUE;
} else {
return lastNode.jjtAccept(this, reflectInfo);
}