@Override public PsiImportStatementStub createStub(LighterAST tree, LighterASTNode node, 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.ASTERISK) { isOnDemand = true; } } byte flags = PsiImportStatementStubImpl.packFlags(isOnDemand, node.getTokenType() == JavaElementType.IMPORT_STATIC_STATEMENT); return new PsiImportStatementStubImpl(parentStub, refText, flags); }
@Override public PsiImportStatementStub createStub(LighterAST tree, LighterASTNode node, 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 = SourceUtil.getReferenceText(tree, child); } else if (type == JavaTokenType.ASTERISK) { isOnDemand = true; } } byte flags = PsiImportStatementStubImpl.packFlags(isOnDemand, node.getTokenType() == JavaElementType.IMPORT_STATIC_STATEMENT); return new PsiImportStatementStubImpl(parentStub, refText, flags); }
@Override public PsiImportStatementStub createStub(LighterAST tree, LighterASTNode node, 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.ASTERISK) { isOnDemand = true; } } byte flags = PsiImportStatementStubImpl.packFlags(isOnDemand, node.getTokenType() == JavaElementType.IMPORT_STATIC_STATEMENT); return new PsiImportStatementStubImpl(parentStub, refText, flags); }
@NotNull @Override public PsiImportStatementStub deserialize(@NotNull final StubInputStream dataStream, final StubElement parentStub) throws IOException { final byte flags = dataStream.readByte(); final StringRef refText = dataStream.readName(); return new PsiImportStatementStubImpl(parentStub, refText, flags); }
@Override public void serialize(@NotNull final PsiImportStatementStub stub, @NotNull final StubOutputStream dataStream) throws IOException { dataStream.writeByte(((PsiImportStatementStubImpl)stub).getFlags()); dataStream.writeName(stub.getImportReferenceText()); }
@Override public void serialize(@NotNull final PsiImportStatementStub stub, @NotNull final StubOutputStream dataStream) throws IOException { dataStream.writeByte(((PsiImportStatementStubImpl) stub).getFlags()); dataStream.writeName(stub.getImportReferenceText()); }