下面列出了怎么用com.intellij.psi.stubs.StubInputStream的API类实例代码及写法,或者点击链接到github查看源代码。
@NotNull
public PsiModuleStub deserialize(@NotNull final StubInputStream dataStream, final StubElement parentStub) throws IOException {
StringRef moduleName = dataStream.readName();
String path = dataStream.readUTFFast();
boolean isComponent = dataStream.readBoolean();
boolean isInterface = dataStream.readBoolean();
assert moduleName != null;
String alias = null;
boolean isAlias = dataStream.readBoolean();
if (isAlias) {
alias = dataStream.readUTFFast();
}
return new PsiModuleStub(parentStub, this, moduleName, path, alias, isComponent, isInterface);
}
@Nonnull
@Override
public CSharpVariableDeclStub<V> deserialize(@Nonnull StubInputStream stubInputStream, StubElement stubElement) throws IOException
{
int otherModifierMask = stubInputStream.readVarInt();
String parentQName = null;
if(supportsParentQName())
{
parentQName = StringRef.toString(stubInputStream.readName());
}
String initializerText = null;
if(supportsInitializer(otherModifierMask))
{
initializerText = StringRef.toString(stubInputStream.readName());
}
return new CSharpVariableDeclStub<>(stubElement, this, parentQName, otherModifierMask, initializerText);
}
@Nullable
public static QualifiedName deserialize(StubInputStream dataStream) throws IOException {
QualifiedName qName;
int size = dataStream.readVarInt();
if (size == 0) {
qName = null;
}
else {
qName = new QualifiedName(size);
for (int i = 0; i < size; i++) {
final StringRef name = dataStream.readName();
qName.myComponents.add(name == null ? null : name.getString());
}
}
return qName;
}
@NotNull
@Override
public AtStateStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub)
throws IOException {
final StringRef ref = dataStream.readName();
final StringRef ref2 = dataStream.readName();
return new AtStateStub(
parentStub, ref.getString(), ref2.getString());
}
@NotNull
@Override
public TemplateDefinitionStub deserialize(
@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
final StringRef ref = dataStream.readName();
return new TemplateDefinitionStub(parentStub, ref.getString());
}
@NotNull
@Override
public NamespaceDeclarationStub deserialize(
@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
final StringRef ref = dataStream.readName();
return new NamespaceDeclarationStub(parentStub, ref.getString());
}
@NotNull
@Override
public AtParamStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub)
throws IOException {
final StringRef ref = dataStream.readName();
final StringRef ref2 = dataStream.readName();
return new AtParamStub(
parentStub, ref.getString(), ref2.getString(), dataStream.readBoolean());
}
@NotNull
@Override
public S deserialize(@NotNull StubInputStream dataStream, StubElement parentStub)
throws IOException {
return createStub(parentStub, dataStream.readName().getString(),
dataStream.readName().getString());
}
@NotNull
public BashVarStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
StringRef ref = dataStream.readName();
int prefixLength = dataStream.readInt();
return new BashVarStubImpl(parentStub, ref, this, prefixLength);
}
@NotNull
public BashVarDefStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
StringRef ref = dataStream.readName();
boolean readOnly = dataStream.readBoolean();
return new BashVarDefStubImpl(parentStub, ref, this, readOnly);
}
@NotNull
public BashCommandStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
StringRef bashCommandFilename = dataStream.readName();
boolean internalCommandBash3 = dataStream.readBoolean();
boolean internalCommandBash4 = dataStream.readBoolean();
boolean genericCommand = dataStream.readBoolean();
return new BashCommandStubImpl(parentStub, StringRef.toString(bashCommandFilename), this, internalCommandBash3, internalCommandBash4, genericCommand);
}
@Nonnull
@Override
public CSharpAttributeListStub deserialize(@Nonnull StubInputStream stubInputStream, StubElement stubElement) throws IOException
{
int targetIndex = stubInputStream.readVarInt();
return new CSharpAttributeListStub(stubElement, this, targetIndex == -1 ? null : DotNetAttributeTargetType.values()[targetIndex]);
}
@Nonnull
@Override
public CSharpMethodDeclStub deserialize(@Nonnull StubInputStream stubInputStream, StubElement stubElement) throws IOException
{
StringRef qname = stubInputStream.readName();
int otherModifierMask = stubInputStream.readVarInt();
int operatorIndex = stubInputStream.readVarInt();
return new CSharpMethodDeclStub(stubElement, StringRef.toString(qname), otherModifierMask, operatorIndex);
}
@Nonnull
@Override
public CSharpWithIntValueStub<CSharpArrayType> deserialize(@Nonnull StubInputStream stubInputStream, StubElement stubElement) throws IOException
{
int i = stubInputStream.readVarInt();
return new CSharpWithIntValueStub<>(stubElement, this, i);
}
@Nonnull
@Override
public CSharpIndexMethodDeclStub deserialize(@Nonnull StubInputStream inputStream, StubElement stubElement) throws IOException
{
StringRef qname = inputStream.readName();
return new CSharpIndexMethodDeclStub(stubElement, StringRef.toString(qname));
}
@Nonnull
@Override
public CSharpIdentifierStub deserialize(@Nonnull StubInputStream dataStream, StubElement parentStub) throws IOException
{
StringRef nameRef = dataStream.readName();
return new CSharpIdentifierStub(parentStub, this, nameRef);
}
@Nonnull
@Override
public CSharpMethodDeclStub deserialize(@Nonnull StubInputStream stubInputStream, StubElement stubElement) throws IOException
{
StringRef qname = stubInputStream.readName();
return new CSharpMethodDeclStub(stubElement, this, StringRef.toString(qname), 0, -1);
}
@Nonnull
@Override
public CSharpWithStringValueStub<CSharpGenericConstraint> deserialize(@Nonnull StubInputStream inputStream,
StubElement stubElement) throws IOException
{
StringRef text = inputStream.readName();
return new CSharpWithStringValueStub<CSharpGenericConstraint>(stubElement, this, text);
}
@Nonnull
@Override
public CSharpNamespaceDeclStub deserialize(@Nonnull StubInputStream stubInputStream, StubElement stubElement) throws IOException
{
StringRef referenceTextRef = stubInputStream.readName();
return new CSharpNamespaceDeclStub(stubElement, this, referenceTextRef);
}
@Nonnull
@Override
public CSharpXXXAccessorStub deserialize(@Nonnull StubInputStream inputStream, StubElement stubElement) throws IOException
{
int otherModifiers = inputStream.readVarInt();
return new CSharpXXXAccessorStub(stubElement, otherModifiers);
}
@Nonnull
@Override
public CSharpReferenceExpressionStub deserialize(@Nonnull StubInputStream dataStream, StubElement parentStub) throws IOException
{
StringRef referenceText = dataStream.readName();
int kind = dataStream.readVarInt();
int memberAccessType = dataStream.readVarInt();
boolean global = dataStream.readBoolean();
return new CSharpReferenceExpressionStub(parentStub, this, StringRef.toString(referenceText), kind, memberAccessType, global);
}
@Nonnull
@Override
public CSharpWithIntValueStub<CSharpNativeType> deserialize(@Nonnull StubInputStream stubInputStream, StubElement stubElement) throws IOException
{
int index = stubInputStream.readVarInt();
return new CSharpWithIntValueStub<CSharpNativeType>(stubElement, this, index);
}
@Nonnull
@Override
public CSharpModifierListStub deserialize(@Nonnull StubInputStream stubInputStream, StubElement stubElement) throws IOException
{
int modifierMask = stubInputStream.readVarInt();
return new CSharpModifierListStub(stubElement, this, modifierMask);
}
@Nonnull
@Override
public CSharpWithIntValueStub<CSharpGenericConstraintKeywordValue> deserialize(@Nonnull StubInputStream stubInputStream,
StubElement stubElement) throws IOException
{
int index = stubInputStream.readVarInt();
return new CSharpWithIntValueStub<CSharpGenericConstraintKeywordValue>(stubElement, this, index);
}
@Nonnull
@Override
public CSharpMethodDeclStub deserialize(@Nonnull StubInputStream stubInputStream, StubElement stubElement) throws IOException
{
StringRef qname = stubInputStream.readName();
int otherModifierMask = stubInputStream.readVarInt();
return new CSharpMethodDeclStub(stubElement, this, StringRef.toString(qname), otherModifierMask, -1);
}
@Nonnull
@Override
public CSharpWithStringValueStub<CSharpUsingNamespaceStatement> deserialize(@Nonnull StubInputStream stubInputStream,
StubElement stubElement) throws IOException
{
StringRef referenceText = stubInputStream.readName();
return new CSharpWithStringValueStub<CSharpUsingNamespaceStatement>(stubElement, this, referenceText);
}
@Nonnull
@Override
public CSharpTypeListStub deserialize(@Nonnull StubInputStream stubInputStream, StubElement stubElement) throws IOException
{
byte value = stubInputStream.readByte();
String[] refs = new String[value];
for(int i = 0; i < value; i++)
{
refs[i] = StringRef.toString(stubInputStream.readName());
}
return new CSharpTypeListStub(stubElement, this, refs);
}
@Nonnull
@Override
public CSharpWithStringValueStub<CSharpAttribute> deserialize(@Nonnull StubInputStream stubInputStream,
StubElement stubElement) throws IOException
{
StringRef referenceText = stubInputStream.readName();
return new CSharpWithStringValueStub<CSharpAttribute>(stubElement, this, referenceText);
}
@Nonnull
@Override
public CSharpTypeDeclStub deserialize(@Nonnull StubInputStream stubInputStream, StubElement stubElement) throws IOException
{
StringRef parentQName = stubInputStream.readName();
StringRef vmQName = stubInputStream.readName();
int otherModifierMask = stubInputStream.readVarInt();
return new CSharpTypeDeclStub(stubElement, StringRef.toString(parentQName), StringRef.toString(vmQName), otherModifierMask);
}
@Nonnull
@Override
public CSharpWithStringValueStub<CSharpUserType> deserialize(@Nonnull StubInputStream stubInputStream,
StubElement stubElement) throws IOException
{
StringRef ref = stubInputStream.readName();
return new CSharpWithStringValueStub<CSharpUserType>(stubElement, this, ref);
}