本文整理汇总了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
}
示例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;
}