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


Java TypeBinding.qualifiedPackageName方法代码示例

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


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

示例1: typeBindingToSignature

import org.eclipse.jdt.internal.compiler.lookup.TypeBinding; //导入方法依赖的package包/类
private static String typeBindingToSignature(TypeBinding binding) {
	binding = binding.erasure();
	if (binding != null && binding.isBaseType()) {
		return new String (binding.sourceName());
	} else if (binding instanceof ReferenceBinding) {
		String pkg = binding.qualifiedPackageName() == null ? "" : new String(binding.qualifiedPackageName());
		String qsn = binding.qualifiedSourceName() == null ? "" : new String(binding.qualifiedSourceName());
		return pkg.isEmpty() ? qsn : (pkg + "." + qsn);
	} else if (binding instanceof ArrayBinding) {
		StringBuilder out = new StringBuilder();
		out.append(typeBindingToSignature(binding.leafComponentType()));
		for (int i = 0; i < binding.dimensions(); i++) out.append("[]");
		return out.toString();
	}
	
	return "";
}
 
开发者ID:git03394538,项目名称:lombok-ianchiu,代码行数:18,代码来源:PatchDelegate.java

示例2: createNameRef

import org.eclipse.jdt.internal.compiler.lookup.TypeBinding; //导入方法依赖的package包/类
private static NameReference createNameRef(TypeBinding typeBinding, ASTNode source) {
	long p = ((long) source.sourceStart << 32) | source.sourceEnd;
	char[] pkg = typeBinding.qualifiedPackageName();
	char[] basename = typeBinding.qualifiedSourceName();
	
	StringBuilder sb = new StringBuilder();
	if (pkg != null) sb.append(pkg);
	if (sb.length() > 0) sb.append(".");
	sb.append(basename);
	
	String tName = sb.toString();
	
	if (tName.indexOf('.') == -1) {
		return new SingleNameReference(basename, p);
	} else {
		char[][] sources;
		String[] in = tName.split("\\.");
		sources = new char[in.length][];
		for (int i = 0; i < in.length; i++) sources[i] = in[i].toCharArray();
		long[] poss = new long[in.length];
		Arrays.fill(poss, p);
		return new QualifiedNameReference(sources, poss, source.sourceStart, source.sourceEnd);
	}
}
 
开发者ID:git03394538,项目名称:lombok-ianchiu,代码行数:25,代码来源:PatchExtensionMethod.java

示例3: isVal

import org.eclipse.jdt.internal.compiler.lookup.TypeBinding; //导入方法依赖的package包/类
private static boolean isVal(TypeReference ref, BlockScope scope) {
	if (!couldBeVal(ref)) return false;
	
	TypeBinding resolvedType = ref.resolvedType;
	if (resolvedType == null) resolvedType = ref.resolveType(scope, false);
	if (resolvedType == null) return false;
	
	char[] pkg = resolvedType.qualifiedPackageName();
	char[] nm = resolvedType.qualifiedSourceName();
	return matches("lombok", pkg) && matches("val", nm);
}
 
开发者ID:git03394538,项目名称:lombok-ianchiu,代码行数:12,代码来源:PatchVal.java

示例4: getFullQualifiedClassName

import org.eclipse.jdt.internal.compiler.lookup.TypeBinding; //导入方法依赖的package包/类
/** Returns the full qualified class name of the given type. */
public static String getFullQualifiedClassName(TypeBinding typeBinding) {
	String packageName = new String(typeBinding.qualifiedPackageName());
	if (!packageName.isEmpty()) {
		packageName += ".";
	}
	return packageName + new String(typeBinding.qualifiedSourceName());
}
 
开发者ID:vimaier,项目名称:conqat,代码行数:9,代码来源:EcjUtils.java


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