675 private static TypeElement topDeclaringType(Element element) {
676 Element enclosing = element.getEnclosingElement();
677 if (enclosing == null || enclosing.getKind() == ElementKind.PACKAGE) {
678 assert element.getKind() == ElementKind.CLASS || element.getKind() == ElementKind.INTERFACE;
679 return (TypeElement) element;
680 }
681 return topDeclaringType(enclosing);
682 }
683
684 /**
685 * The element currently being processed.
686 */
687 private Element currentElement;
688
689 /**
690 * The current processing round.
691 */
692 private RoundEnvironment currentRound;
693
694 @Override
695 public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
696 if (roundEnv.processingOver()) {
697 return true;
698 }
699
700 logMessage("Starting round %s\n", roundEnv);
701
702 TypeElement matchRulesTypeElement = getTypeElement(MATCH_RULES_CLASS_NAME);
703 TypeElement matchRuleTypeElement = getTypeElement(MATCH_RULE_CLASS_NAME);
704
705 TypeMirror matchRulesTypeMirror = matchRulesTypeElement.asType();
706 TypeMirror matchRuleTypeMirror = matchRuleTypeElement.asType();
707
708 TypeElement matchableNodeTypeElement = getTypeElement(MATCHABLE_NODE_CLASS_NAME);
709 TypeElement matchableNodesTypeElement = getTypeElement(MATCHABLE_NODES_CLASS_NAME);
710
711 currentRound = roundEnv;
712 try {
713 for (Element element : roundEnv.getElementsAnnotatedWith(matchableNodeTypeElement)) {
714 currentElement = element;
715 logMessage("%s\n", element);
|
675 private static TypeElement topDeclaringType(Element element) {
676 Element enclosing = element.getEnclosingElement();
677 if (enclosing == null || enclosing.getKind() == ElementKind.PACKAGE) {
678 assert element.getKind() == ElementKind.CLASS || element.getKind() == ElementKind.INTERFACE;
679 return (TypeElement) element;
680 }
681 return topDeclaringType(enclosing);
682 }
683
684 /**
685 * The element currently being processed.
686 */
687 private Element currentElement;
688
689 /**
690 * The current processing round.
691 */
692 private RoundEnvironment currentRound;
693
694 @Override
695 public boolean doProcess(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
696 if (roundEnv.processingOver()) {
697 return true;
698 }
699
700 logMessage("Starting round %s\n", roundEnv);
701
702 TypeElement matchRulesTypeElement = getTypeElement(MATCH_RULES_CLASS_NAME);
703 TypeElement matchRuleTypeElement = getTypeElement(MATCH_RULE_CLASS_NAME);
704
705 TypeMirror matchRulesTypeMirror = matchRulesTypeElement.asType();
706 TypeMirror matchRuleTypeMirror = matchRuleTypeElement.asType();
707
708 TypeElement matchableNodeTypeElement = getTypeElement(MATCHABLE_NODE_CLASS_NAME);
709 TypeElement matchableNodesTypeElement = getTypeElement(MATCHABLE_NODES_CLASS_NAME);
710
711 currentRound = roundEnv;
712 try {
713 for (Element element : roundEnv.getElementsAnnotatedWith(matchableNodeTypeElement)) {
714 currentElement = element;
715 logMessage("%s\n", element);
|