Looks up an import node by its alias name. Searches regular imports and returns the matching node. Caches import alias mappings as node metadata for performance. @param alias the imported name to look up @return the ImportNode for that import, or null if not found
(final String alias)
| 196 | * @return the {@link ImportNode} for that import, or null if not found |
| 197 | */ |
| 198 | public ImportNode getImport(final String alias) { |
| 199 | Map<String, ImportNode> aliases = getNodeMetaData("import.aliases", x -> |
| 200 | imports.stream().collect(Collectors.toMap(ImportNode::getAlias, n -> n, (n, m) -> m))); |
| 201 | return aliases.get(alias); |
| 202 | } |
| 203 | |
| 204 | /** |
| 205 | * Registers a regular import (e.g., {@code import java.util.List}). |