Java 类com.intellij.psi.impl.java.stubs.impl.PsiImportStatementStubImpl 实例源码

项目:intellij-ce-playground    文件:JavaImportStatementElementType.java   
@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);
}
项目:tools-idea    文件:JavaImportStatementElementType.java   
@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);
}
项目:consulo-java    文件:JavaImportStatementElementType.java   
@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);
}
项目:intellij-ce-playground    文件:JavaImportStatementElementType.java   
@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);
}
项目:tools-idea    文件:JavaImportStatementElementType.java   
@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);
}
项目:consulo-java    文件:JavaImportStatementElementType.java   
@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);
}
项目:intellij-ce-playground    文件:JavaImportStatementElementType.java   
@Override
public void serialize(@NotNull final PsiImportStatementStub stub, @NotNull final StubOutputStream dataStream) throws IOException {
  dataStream.writeByte(((PsiImportStatementStubImpl)stub).getFlags());
  dataStream.writeName(stub.getImportReferenceText());
}
项目:tools-idea    文件:JavaImportStatementElementType.java   
@Override
public void serialize(@NotNull final PsiImportStatementStub stub, @NotNull final StubOutputStream dataStream) throws IOException {
  dataStream.writeByte(((PsiImportStatementStubImpl)stub).getFlags());
  dataStream.writeName(stub.getImportReferenceText());
}
项目:consulo-java    文件:JavaImportStatementElementType.java   
@Override
public void serialize(@NotNull final PsiImportStatementStub stub, @NotNull final StubOutputStream dataStream) throws IOException
{
    dataStream.writeByte(((PsiImportStatementStubImpl) stub).getFlags());
    dataStream.writeName(stub.getImportReferenceText());
}