use of com.intellij.psi.impl.java.stubs.impl.PsiImportStatementStubImpl in project intellij-community by JetBrains.
the class JavaImportStatementElementType method createStub.
@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);
}
use of com.intellij.psi.impl.java.stubs.impl.PsiImportStatementStubImpl in project intellij-community by JetBrains.
the class JavaImportStatementElementType method deserialize.
@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);
}
Aggregations