當前位置: 首頁>>代碼示例>>Java>>正文


Java MemberReference.getErasedSignature方法代碼示例

本文整理匯總了Java中com.strobel.assembler.metadata.MemberReference.getErasedSignature方法的典型用法代碼示例。如果您正苦於以下問題:Java MemberReference.getErasedSignature方法的具體用法?Java MemberReference.getErasedSignature怎麽用?Java MemberReference.getErasedSignature使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.strobel.assembler.metadata.MemberReference的用法示例。


在下文中一共展示了MemberReference.getErasedSignature方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: visitMemberReferenceExpression

import com.strobel.assembler.metadata.MemberReference; //導入方法依賴的package包/類
@Override
public Void visitMemberReferenceExpression(MemberReferenceExpression node, SourceIndex index) {
	MemberReference ref = node.getUserData(Keys.MEMBER_REFERENCE);
	if (ref != null) {
		// make sure this is actually a field
		if (ref.getErasedSignature().indexOf('(') >= 0) {
			throw new Error("Expected a field here! got " + ref);
		}
		
		ClassEntry classEntry = new ClassEntry(ref.getDeclaringType().getInternalName());
		FieldEntry fieldEntry = new FieldEntry(classEntry, ref.getName(), new Type(ref.getErasedSignature()));
		index.addReference(node.getMemberNameToken(), fieldEntry, m_behaviorEntry);
	}
	
	return recurse(node, index);
}
 
開發者ID:cccssw,項目名稱:enigma-vk,代碼行數:17,代碼來源:SourceIndexBehaviorVisitor.java

示例2: visitMemberReferenceExpression

import com.strobel.assembler.metadata.MemberReference; //導入方法依賴的package包/類
@Override
public Void visitMemberReferenceExpression(MemberReferenceExpression node,
	SourceIndex index)
{
	MemberReference ref = node.getUserData(Keys.MEMBER_REFERENCE);
	if(ref != null)
	{
		// make sure this is actually a field
		if(ref.getErasedSignature().indexOf('(') >= 0)
			throw new Error("Expected a field here! got " + ref);
		
		ClassEntry classEntry =
			new ClassEntry(ref.getDeclaringType().getInternalName());
		FieldEntry fieldEntry =
			new FieldEntry(classEntry, ref.getName(), new Type(
				ref.getErasedSignature()));
		index.addReference(node.getMemberNameToken(), fieldEntry,
			m_behaviorEntry);
	}
	
	return recurse(node, index);
}
 
開發者ID:Wurst-Imperium,項目名稱:Wurst-Enigma,代碼行數:23,代碼來源:SourceIndexBehaviorVisitor.java

示例3: visitIdentifierExpression

import com.strobel.assembler.metadata.MemberReference; //導入方法依賴的package包/類
@Override
public Void visitIdentifierExpression(IdentifierExpression node,
	SourceIndex index)
{
	MemberReference ref = node.getUserData(Keys.MEMBER_REFERENCE);
	if(ref != null)
	{
		ClassEntry classEntry =
			new ClassEntry(ref.getDeclaringType().getInternalName());
		FieldEntry fieldEntry =
			new FieldEntry(classEntry, ref.getName(), new Type(
				ref.getErasedSignature()));
		index.addReference(node.getIdentifierToken(), fieldEntry,
			m_behaviorEntry);
	}
	
	return recurse(node, index);
}
 
開發者ID:Wurst-Imperium,項目名稱:Wurst-Enigma,代碼行數:19,代碼來源:SourceIndexBehaviorVisitor.java

示例4: visitObjectCreationExpression

import com.strobel.assembler.metadata.MemberReference; //導入方法依賴的package包/類
@Override
public Void visitObjectCreationExpression(ObjectCreationExpression node,
	SourceIndex index)
{
	MemberReference ref = node.getUserData(Keys.MEMBER_REFERENCE);
	if(ref != null)
	{
		ClassEntry classEntry =
			new ClassEntry(ref.getDeclaringType().getInternalName());
		ConstructorEntry constructorEntry =
			new ConstructorEntry(classEntry, new Signature(
				ref.getErasedSignature()));
		if(node.getType() instanceof SimpleType)
		{
			SimpleType simpleTypeNode = (SimpleType)node.getType();
			index.addReference(simpleTypeNode.getIdentifierToken(),
				constructorEntry, m_behaviorEntry);
		}
	}
	
	return recurse(node, index);
}
 
開發者ID:Wurst-Imperium,項目名稱:Wurst-Enigma,代碼行數:23,代碼來源:SourceIndexBehaviorVisitor.java

示例5: visitIdentifierExpression

import com.strobel.assembler.metadata.MemberReference; //導入方法依賴的package包/類
@Override
public Void visitIdentifierExpression(IdentifierExpression node, SourceIndex index) {
	MemberReference ref = node.getUserData(Keys.MEMBER_REFERENCE);
	if (ref != null) {
		ClassEntry classEntry = new ClassEntry(ref.getDeclaringType().getInternalName());
		FieldEntry fieldEntry = new FieldEntry(classEntry, ref.getName(), new Type(ref.getErasedSignature()));
		index.addReference(node.getIdentifierToken(), fieldEntry, m_behaviorEntry);
	}
	
	return recurse(node, index);
}
 
開發者ID:cccssw,項目名稱:enigma-vk,代碼行數:12,代碼來源:SourceIndexBehaviorVisitor.java

示例6: visitObjectCreationExpression

import com.strobel.assembler.metadata.MemberReference; //導入方法依賴的package包/類
@Override
public Void visitObjectCreationExpression(ObjectCreationExpression node, SourceIndex index) {
	MemberReference ref = node.getUserData(Keys.MEMBER_REFERENCE);
	if (ref != null) {
		ClassEntry classEntry = new ClassEntry(ref.getDeclaringType().getInternalName());
		ConstructorEntry constructorEntry = new ConstructorEntry(classEntry, new Signature(ref.getErasedSignature()));
		if (node.getType() instanceof SimpleType) {
			SimpleType simpleTypeNode = (SimpleType)node.getType();
			index.addReference(simpleTypeNode.getIdentifierToken(), constructorEntry, m_behaviorEntry);
		}
	}
	
	return recurse(node, index);
}
 
開發者ID:cccssw,項目名稱:enigma-vk,代碼行數:15,代碼來源:SourceIndexBehaviorVisitor.java

示例7: MemberInfo

import com.strobel.assembler.metadata.MemberReference; //導入方法依賴的package包/類
public MemberInfo(MemberReference mr) {
    this.type = new TypeInfo(mr.getDeclaringType().getInternalName());
    this.name = mr.getName();
    this.signature = mr.getErasedSignature();
}
 
開發者ID:amaembo,項目名稱:huntbugs,代碼行數:6,代碼來源:WarningAnnotation.java

示例8: visitInvocationExpression

import com.strobel.assembler.metadata.MemberReference; //導入方法依賴的package包/類
@Override
public Void visitInvocationExpression(InvocationExpression node,
	SourceIndex index)
{
	MemberReference ref = node.getUserData(Keys.MEMBER_REFERENCE);
	
	// get the behavior entry
	ClassEntry classEntry =
		new ClassEntry(ref.getDeclaringType().getInternalName());
	BehaviorEntry behaviorEntry = null;
	if(ref instanceof MethodReference)
	{
		MethodReference methodRef = (MethodReference)ref;
		if(methodRef.isConstructor())
			behaviorEntry =
				new ConstructorEntry(classEntry, new Signature(
					ref.getErasedSignature()));
		else if(methodRef.isTypeInitializer())
			behaviorEntry = new ConstructorEntry(classEntry);
		else
			behaviorEntry =
				new MethodEntry(classEntry, ref.getName(), new Signature(
					ref.getErasedSignature()));
	}
	if(behaviorEntry != null)
	{
		// get the node for the token
		AstNode tokenNode = null;
		if(node.getTarget() instanceof MemberReferenceExpression)
			tokenNode =
				((MemberReferenceExpression)node.getTarget())
					.getMemberNameToken();
		else if(node.getTarget() instanceof SuperReferenceExpression)
			tokenNode = node.getTarget();
		else if(node.getTarget() instanceof ThisReferenceExpression)
			tokenNode = node.getTarget();
		if(tokenNode != null)
			index.addReference(tokenNode, behaviorEntry, m_behaviorEntry);
	}
	
	return recurse(node, index);
}
 
開發者ID:Wurst-Imperium,項目名稱:Wurst-Enigma,代碼行數:43,代碼來源:SourceIndexBehaviorVisitor.java


注:本文中的com.strobel.assembler.metadata.MemberReference.getErasedSignature方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。