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


Java TypeConstants.PACKAGE_INFO_NAME属性代码示例

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


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

示例1: createPackageInfoType

public void createPackageInfoType() {
	TypeDeclaration declaration = new TypeDeclaration(this.compilationResult);
	declaration.name = TypeConstants.PACKAGE_INFO_NAME;
	declaration.modifiers = ClassFileConstants.AccDefault | ClassFileConstants.AccInterface;
	declaration.javadoc = this.javadoc;
	this.types[0] = declaration; // Assumes the first slot is meant for this type
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:7,代码来源:CompilationUnitDeclaration.java

示例2: newElement

/**
 * Create a new element that knows what kind it is even if the binding is unresolved.
 */
public Element newElement(Binding binding, ElementKind kindHint) {
	switch (binding.kind()) {
	case Binding.FIELD:
	case Binding.LOCAL:
	case Binding.VARIABLE:
		return new VariableElementImpl(_env, (VariableBinding) binding);
	case Binding.TYPE:
	case Binding.GENERIC_TYPE:
		ReferenceBinding referenceBinding = (ReferenceBinding)binding;
		if ((referenceBinding.tagBits & TagBits.HasMissingType) != 0) {
			return new ErrorTypeElement(this._env, referenceBinding);
		}
		if (referenceBinding.sourceName == TypeConstants.PACKAGE_INFO_NAME) {
			return new PackageElementImpl(_env, referenceBinding.fPackage);
		}
		return new TypeElementImpl(_env, referenceBinding, kindHint);
	case Binding.METHOD:
		return new ExecutableElementImpl(_env, (MethodBinding)binding);
	case Binding.RAW_TYPE:
	case Binding.PARAMETERIZED_TYPE:
		return new TypeElementImpl(_env, ((ParameterizedTypeBinding)binding).genericType(), kindHint);
	case Binding.PACKAGE:
		return new PackageElementImpl(_env, (PackageBinding)binding);
	case Binding.TYPE_PARAMETER:
		return new TypeParameterElementImpl(_env, (TypeVariableBinding)binding);
		// TODO: fill in the rest of these
	case Binding.IMPORT:
	case Binding.ARRAY_TYPE:
	case Binding.BASE_TYPE:
	case Binding.WILDCARD_TYPE:
	case Binding.INTERSECTION_TYPE:
		throw new UnsupportedOperationException("NYI: binding type " + binding.kind()); //$NON-NLS-1$
	}
	return null;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:38,代码来源:Factory.java


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