PsiImportStatementStub (@NotNull LighterAST tree, @NotNull LighterASTNode node, @NotNull StubElement<?> parentStub) { boolean isOnDemand = false; String refText = null; for (LighterASTNode child : tree.getChildren(node)) { IElementType type = child.getTokenType(); if (type == JavaElementType.JAVA_CODE_REFERENCE || type == JavaElementType.IMPORT_STATIC_REFERENCE) { refText = JavaSourceUtil.getReferenceText(tree, child); } else if (type == JavaTokenType.DOT) { isOnDemand = true; } } byte flags = PsiImportStatementStubImpl.packFlags(isOnDemand, node.getTokenType() == JavaElementType.IMPORT_STATIC_STATEMENT); return new PsiImportStatementStubImpl(parentStub, refText, flags); }