当前位置: 首页>>代码示例>>Java>>正文


Java StubInputStream.readByte方法代码示例

本文整理汇总了Java中com.intellij.psi.stubs.StubInputStream.readByte方法的典型用法代码示例。如果您正苦于以下问题:Java StubInputStream.readByte方法的具体用法?Java StubInputStream.readByte怎么用?Java StubInputStream.readByte使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.psi.stubs.StubInputStream的用法示例。


在下文中一共展示了StubInputStream.readByte方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: deserialize

import com.intellij.psi.stubs.StubInputStream; //导入方法依赖的package包/类
@NotNull
@Override
public PsiClassStub deserialize(@NotNull final StubInputStream dataStream, final StubElement parentStub) throws IOException {
  byte flags = dataStream.readByte();
  boolean isAnonymous = PsiClassStubImpl.isAnonymous(flags);
  boolean isEnumConst = PsiClassStubImpl.isEnumConstInitializer(flags);
  JavaClassElementType type = typeForClass(isAnonymous, isEnumConst);

  if (!isAnonymous) {
    StringRef name = dataStream.readName();
    StringRef qname = dataStream.readName();
    int languageLevelId = dataStream.readByte();
    StringRef sourceFileName = dataStream.readName();
    PsiClassStubImpl classStub = new PsiClassStubImpl(type, parentStub, qname, name, null, flags);
    classStub.setLanguageLevel(LanguageLevel.values()[languageLevelId]);
    classStub.setSourceFileName(sourceFileName);
    return classStub;
  }
  else {
    StringRef baseRef = dataStream.readName();
    return new PsiClassStubImpl(type, parentStub, null, null, baseRef, flags);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:JavaClassElementType.java

示例2: deserialize

import com.intellij.psi.stubs.StubInputStream; //导入方法依赖的package包/类
@NotNull
@Override
public PsiClassStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException
{
	byte flags = dataStream.readByte();
	boolean isAnonymous = PsiClassStubImpl.isAnonymous(flags);

	if(!isAnonymous)
	{
		StringRef name = dataStream.readName();
		StringRef qname = dataStream.readName();
		StringRef sourceFileName = dataStream.readName();
		PsiClassStubImpl classStub = new PsiClassStubImpl(this, parentStub, StringRef.toString(qname), StringRef.toString(name), null, flags);
		classStub.setSourceFileName(StringRef.toString(sourceFileName));
		return classStub;
	}
	else
	{
		StringRef baseRef = dataStream.readName();
		return new PsiClassStubImpl(this, parentStub, null, null, StringRef.toString(baseRef), flags);
	}
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:23,代码来源:JavaClassElementType.java

示例3: readTYPE

import com.intellij.psi.stubs.StubInputStream; //导入方法依赖的package包/类
@NotNull
public static TypeInfo readTYPE(@NotNull StubInputStream record) throws IOException
{
	int flags = 0xFF & record.readByte();
	if(flags == FREQUENT_INDEX_MASK)
	{
		return NULL;
	}

	int frequentIndex = FREQUENT_INDEX_MASK & flags;
	byte arrayCount = isSet(flags, HAS_ARRAY_COUNT) ? record.readByte() : 0;
	boolean hasEllipsis = isSet(flags, HAS_ELLIPSIS);

	String text = frequentIndex == 0 ? StringRef.toString(record.readName()) : ourIndexFrequentType[frequentIndex];

	return new TypeInfo(text, arrayCount, hasEllipsis, PsiAnnotationStub.EMPTY_ARRAY);
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:18,代码来源:TypeInfo.java

示例4: deserialize

import com.intellij.psi.stubs.StubInputStream; //导入方法依赖的package包/类
@NotNull
@Override
public PsiMethodStub deserialize(@NotNull final StubInputStream dataStream, final StubElement parentStub) throws IOException {
  StringRef name = dataStream.readName();
  final TypeInfo type = TypeInfo.readTYPE(dataStream);
  byte flags = dataStream.readByte();
  final StringRef defaultMethodValue = PsiMethodStubImpl.isAnnotationMethod(flags) ? dataStream.readName() : null;
  return new PsiMethodStubImpl(parentStub, StringRef.toString(name), type, flags, StringRef.toString(defaultMethodValue));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:JavaMethodElementType.java

示例5: deserialize

import com.intellij.psi.stubs.StubInputStream; //导入方法依赖的package包/类
@NotNull
@Override
public PsiFieldStub deserialize(@NotNull final StubInputStream dataStream, final StubElement parentStub) throws IOException {
  final StringRef name = dataStream.readName();
  final TypeInfo type = TypeInfo.readTYPE(dataStream);
  final StringRef initializerText = dataStream.readName();
  final byte flags = dataStream.readByte();
  return new PsiFieldStubImpl(parentStub, name, type, initializerText, flags);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:JavaFieldStubElementType.java

示例6: deserialize

import com.intellij.psi.stubs.StubInputStream; //导入方法依赖的package包/类
@NotNull
@Override
public PsiClassReferenceListStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
  byte role = dataStream.readByte();

  int len = dataStream.readVarInt();
  StringRef[] names = StringRef.createArray(len);
  for (int i = 0; i < names.length; i++) {
    names[i] = dataStream.readName();
  }

  PsiReferenceList.Role decodedRole = decodeRole(role);
  return new PsiClassReferenceListStubImpl(roleToElementType(decodedRole), parentStub, names, decodedRole);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:JavaClassReferenceListElementType.java

示例7: deserialize

import com.intellij.psi.stubs.StubInputStream; //导入方法依赖的package包/类
@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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:JavaImportStatementElementType.java

示例8: readTYPE

import com.intellij.psi.stubs.StubInputStream; //导入方法依赖的package包/类
@NotNull
public static TypeInfo readTYPE(@NotNull StubInputStream record) throws IOException {
  int flags = 0xFF & record.readByte();
  if (flags == FREQUENT_INDEX_MASK) {
    return NULL;
  }

  int frequentIndex = FREQUENT_INDEX_MASK & flags;
  byte arrayCount = isSet(flags, HAS_ARRAY_COUNT) ? record.readByte() : 0;
  boolean hasEllipsis = isSet(flags, HAS_ELLIPSIS);

  String text = frequentIndex == 0 ? StringRef.toString(record.readName()) : ourIndexFrequentType[frequentIndex];

  return new TypeInfo(text, arrayCount, hasEllipsis, PsiAnnotationStub.EMPTY_ARRAY);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:TypeInfo.java

示例9: deserialize

import com.intellij.psi.stubs.StubInputStream; //导入方法依赖的package包/类
@NotNull
public PyNamedParameterStub deserialize(@NotNull final StubInputStream dataStream, final StubElement parentStub) throws IOException {
  String name = StringRef.toString(dataStream.readName());
  byte flags = dataStream.readByte();
  return new PyNamedParameterStubImpl(name,
                                      (flags & POSITIONAL_CONTAINER) != 0,
                                      (flags & KEYWORD_CONTAINER) != 0,
                                      (flags & HAS_DEFAULT_VALUE) != 0,
                                      parentStub,
                                      getStubElementType());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:PyNamedParameterElementType.java

示例10: deserialize

import com.intellij.psi.stubs.StubInputStream; //导入方法依赖的package包/类
@Override
@NotNull
public GrMethodStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
  StringRef ref = dataStream.readName();
  final String[] annNames = GrStubUtils.readStringArray(dataStream);
  String[] namedParameters = GrStubUtils.readStringArray(dataStream);
  String typeText = GrStubUtils.readNullableString(dataStream);
  final byte flags = dataStream.readByte();
  return new GrMethodStub(parentStub, ref, annNames, namedParameters, this, typeText, flags);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:GrMethodElementType.java

示例11: deserialize

import com.intellij.psi.stubs.StubInputStream; //导入方法依赖的package包/类
@NotNull
@Override
public GrImportStatementStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
  String referenceText = GrStubUtils.readNullableString(dataStream);
  String aliasName = GrStubUtils.readNullableString(dataStream);
  byte flags = dataStream.readByte();

  return new GrImportStatementStub(parentStub, this, referenceText, aliasName, flags);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:GrImportStatementElementType.java

示例12: deserializeFieldStub

import com.intellij.psi.stubs.StubInputStream; //导入方法依赖的package包/类
static GrFieldStub deserializeFieldStub(StubInputStream dataStream, StubElement parentStub) throws IOException {
  StringRef ref = dataStream.readName();
  final String[] annNames = GrStubUtils.readStringArray(dataStream);
  final String[] namedParameters = GrStubUtils.readStringArray(dataStream);
  byte flags = dataStream.readByte();
  final String typeText = GrStubUtils.readNullableString(dataStream);
  return new GrFieldStub(parentStub, ref, annNames, namedParameters, GrFieldStub.isEnumConstant(flags) ? GroovyElementTypes.ENUM_CONSTANT
                                                                                                       : GroovyElementTypes.FIELD,
                             flags, typeText);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:GrFieldElementType.java

示例13: deserialize

import com.intellij.psi.stubs.StubInputStream; //导入方法依赖的package包/类
@Override
@NotNull
public GrTypeDefinitionStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException {
  String name = StringRef.toString(dataStream.readName());
  String qname = StringRef.toString(dataStream.readName());
  byte flags = dataStream.readByte();
  String[] superClasses = readStringArray(dataStream);
  String[] annos = readStringArray(dataStream);
  return new GrTypeDefinitionStub(parentStub, name, superClasses, this, qname, annos, flags);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:GrTypeDefinitionElementType.java

示例14: readStringArray

import com.intellij.psi.stubs.StubInputStream; //导入方法依赖的package包/类
private static String[] readStringArray(StubInputStream dataStream) throws IOException {
  byte supersNumber = dataStream.readByte();
  String[] superClasses = new String[supersNumber];
  for (int i = 0; i < supersNumber; i++) {
    superClasses[i] = StringRef.toString(dataStream.readName());
  }
  return superClasses;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:GrTypeDefinitionElementType.java

示例15: readStringArray

import com.intellij.psi.stubs.StubInputStream; //导入方法依赖的package包/类
public static String[] readStringArray(StubInputStream dataStream) throws IOException {
  int length = dataStream.readByte();
  if (length == TOO_LONG) {
    length = dataStream.readInt();
  }
  final String[] annNames = new String[length];
  for (int i = 0; i < length; i++) {
    annNames[i] = dataStream.readName().toString();
  }
  return annNames;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:GrStubUtils.java


注:本文中的com.intellij.psi.stubs.StubInputStream.readByte方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。