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


Java JavaSourceUtil.getReferenceText方法代码示例

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


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

示例1: createStub

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

示例2: createStub

import com.intellij.psi.impl.source.tree.JavaSourceUtil; //导入方法依赖的package包/类
@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);
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:23,代码来源:JavaImportStatementElementType.java

示例3: createStub

import com.intellij.psi.impl.source.tree.JavaSourceUtil; //导入方法依赖的package包/类
@Override
public PsiPackageAccessibilityStatementStub createStub(LighterAST tree, LighterASTNode node, StubElement parentStub)
{
	String refText = null;
	List<String> to = ContainerUtil.newSmartList();

	for(LighterASTNode child : tree.getChildren(node))
	{
		IElementType type = child.getTokenType();
		if(type == JavaElementType.JAVA_CODE_REFERENCE)
		{
			refText = JavaSourceUtil.getReferenceText(tree, child);
		}
		else if(type == JavaElementType.MODULE_REFERENCE)
		{
			to.add(JavaSourceUtil.getReferenceText(tree, child));
		}
	}

	return new PsiPackageAccessibilityStatementStubImpl(parentStub, this, refText, to);
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:22,代码来源:JavaPackageAccessibilityStatementElementType.java

示例4: createStubForFile

import com.intellij.psi.impl.source.tree.JavaSourceUtil; //导入方法依赖的package包/类
@NotNull
@Override
protected StubElement createStubForFile(@NotNull PsiFile file, @NotNull LighterAST tree)
{
	if(!(file instanceof PsiJavaFile))
	{
		return super.createStubForFile(file, tree);
	}

	String refText = "";
	LighterASTNode pkg = LightTreeUtil.firstChildOfType(tree, tree.getRoot(), JavaElementType.PACKAGE_STATEMENT);
	if(pkg != null)
	{
		LighterASTNode ref = LightTreeUtil.firstChildOfType(tree, pkg, JavaElementType.JAVA_CODE_REFERENCE);
		if(ref != null)
		{
			refText = JavaSourceUtil.getReferenceText(tree, ref);
		}
	}
	return new PsiJavaFileStubImpl((PsiJavaFile) file, refText, null, false);
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:22,代码来源:JavaLightStubBuilder.java

示例5: createStub

import com.intellij.psi.impl.source.tree.JavaSourceUtil; //导入方法依赖的package包/类
@Override
public PsiProvidesStatementStub createStub(LighterAST tree, LighterASTNode node, StubElement parentStub)
{
	LighterASTNode ref = LightTreeUtil.firstChildOfType(tree, node, JavaElementType.JAVA_CODE_REFERENCE);
	String refText = ref != null ? JavaSourceUtil.getReferenceText(tree, ref) : null;
	return new PsiProvidesStatementStubImpl(parentStub, refText);
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:8,代码来源:JavaProvidesStatementElementType.java

示例6: createStub

import com.intellij.psi.impl.source.tree.JavaSourceUtil; //导入方法依赖的package包/类
@Override
public PsiUsesStatementStub createStub(LighterAST tree, LighterASTNode node, StubElement parentStub)
{
	LighterASTNode ref = LightTreeUtil.firstChildOfType(tree, node, JavaElementType.JAVA_CODE_REFERENCE);
	String refText = ref != null ? JavaSourceUtil.getReferenceText(tree, ref) : null;
	return new PsiUsesStatementStubImpl(parentStub, refText);
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:8,代码来源:JavaUsesStatementElementType.java

示例7: createStub

import com.intellij.psi.impl.source.tree.JavaSourceUtil; //导入方法依赖的package包/类
@Override
public PsiRequiresStatementStub createStub(LighterAST tree, LighterASTNode node, StubElement parentStub)
{
	LighterASTNode ref = LightTreeUtil.firstChildOfType(tree, node, JavaElementType.MODULE_REFERENCE);
	String refText = ref != null ? JavaSourceUtil.getReferenceText(tree, ref) : null;
	return new PsiRequiresStatementStubImpl(parentStub, refText);
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:8,代码来源:JavaRequiresStatementElementType.java

示例8: getNormalizedText

import com.intellij.psi.impl.source.tree.JavaSourceUtil; //导入方法依赖的package包/类
private String getNormalizedText()
{
	String whiteSpaceAndComments = myCachedNormalizedText;
	if(whiteSpaceAndComments == null)
	{
		myCachedNormalizedText = whiteSpaceAndComments = JavaSourceUtil.getReferenceText(this);
	}
	return whiteSpaceAndComments;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:10,代码来源:PsiJavaCodeReferenceElementImpl.java

示例9: getCachedNormalizedText

import com.intellij.psi.impl.source.tree.JavaSourceUtil; //导入方法依赖的package包/类
private String getCachedNormalizedText()
{
	String whiteSpaceAndComments = myCachedNormalizedText;
	if(whiteSpaceAndComments == null)
	{
		myCachedNormalizedText = whiteSpaceAndComments = JavaSourceUtil.getReferenceText(this);
	}
	return whiteSpaceAndComments;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:10,代码来源:PsiReferenceExpressionImpl.java

示例10: getQualifiedName

import com.intellij.psi.impl.source.tree.JavaSourceUtil; //导入方法依赖的package包/类
@Override
public String getQualifiedName() {
  return JavaSourceUtil.getReferenceText(this);
}
 
开发者ID:HaxeFoundation,项目名称:intellij-haxe,代码行数:5,代码来源:HaxeReferenceImpl.java

示例11: createStub

import com.intellij.psi.impl.source.tree.JavaSourceUtil; //导入方法依赖的package包/类
@Override
public PsiJavaModuleStub createStub(LighterAST tree, LighterASTNode node, StubElement parentStub)
{
	LighterASTNode ref = LightTreeUtil.requiredChildOfType(tree, node, JavaElementType.MODULE_REFERENCE);
	return new PsiJavaModuleStubImpl(parentStub, JavaSourceUtil.getReferenceText(tree, ref));
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:7,代码来源:JavaModuleElementType.java

示例12: getPackageName

import com.intellij.psi.impl.source.tree.JavaSourceUtil; //导入方法依赖的package包/类
@Override
public String getPackageName()
{
	PsiJavaCodeReferenceElement ref = getPackageReference();
	return ref == null ? null : JavaSourceUtil.getReferenceText(ref);
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:7,代码来源:PsiPackageStatementImpl.java


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