Return annotation names from the modifiers child of a Java class/method node.
(class_node)
| 3861 | |
| 3862 | @staticmethod |
| 3863 | def _get_java_annotations(class_node) -> list[str]: |
| 3864 | """Return annotation names from the modifiers child of a Java class/method node.""" |
| 3865 | names: list[str] = [] |
| 3866 | for child in class_node.children: |
| 3867 | if child.type != "modifiers": |
| 3868 | continue |
| 3869 | for mod in child.children: |
| 3870 | if mod.type in ("marker_annotation", "annotation"): |
| 3871 | for sub in mod.children: |
| 3872 | if sub.type == "identifier": |
| 3873 | names.append(sub.text.decode("utf-8", errors="replace")) |
| 3874 | break |
| 3875 | return names |
| 3876 | |
| 3877 | def _emit_spring_injections( |
| 3878 | self, |
no outgoing calls
no test coverage detected