• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java IClassFileAttribute类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.eclipse.jdt.core.util.IClassFileAttribute的典型用法代码示例。如果您正苦于以下问题:Java IClassFileAttribute类的具体用法?Java IClassFileAttribute怎么用?Java IClassFileAttribute使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IClassFileAttribute类属于org.eclipse.jdt.core.util包,在下文中一共展示了IClassFileAttribute类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getAttribute

import org.eclipse.jdt.core.util.IClassFileAttribute; //导入依赖的package包/类
public static IClassFileAttribute getAttribute(
    IClassFileReader classFileReader, char[] attributeName) {
  IClassFileAttribute[] attributes = classFileReader.getAttributes();
  for (int i = 0, max = attributes.length; i < max; i++) {
    if (CharOperation.equals(attributes[i].getAttributeName(), attributeName)) {
      return attributes[i];
    }
  }
  return null;
}
 
开发者ID:eclipse,项目名称:che,代码行数:11,代码来源:Util.java


示例2: getAttribute

import org.eclipse.jdt.core.util.IClassFileAttribute; //导入依赖的package包/类
public static IClassFileAttribute getAttribute(IClassFileReader classFileReader, char[] attributeName) {
	IClassFileAttribute[] attributes = classFileReader.getAttributes();
	for (int i = 0, max = attributes.length; i < max; i++) {
		if (CharOperation.equals(attributes[i].getAttributeName(), attributeName)) {
			return attributes[i];
		}
	}
	return null;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:10,代码来源:Util.java


示例3: CodeAttribute

import org.eclipse.jdt.core.util.IClassFileAttribute; //导入依赖的package包/类
CodeAttribute(byte[] classFileBytes, IConstantPool constantPool, int offset) throws ClassFormatException {
	super(classFileBytes, constantPool, offset);
	this.classFileBytes = classFileBytes;
	this.constantPool = constantPool;
	this.maxStack = u2At(classFileBytes, 6, offset);
	this.maxLocals = u2At(classFileBytes, 8, offset);
	this.codeLength = u4At(classFileBytes, 10, offset);
	this.codeOffset = offset + 14;
	int readOffset = (int) (14 + this.codeLength);
	this.exceptionTableLength = u2At(classFileBytes, readOffset, offset);
	readOffset += 2;
	this.exceptionTableEntries = NO_EXCEPTION_TABLE;
	if (this.exceptionTableLength != 0) {
		this.exceptionTableEntries = new ExceptionTableEntry[this.exceptionTableLength];
		for (int i = 0; i < this.exceptionTableLength; i++) {
			this.exceptionTableEntries [i] = new ExceptionTableEntry(classFileBytes, constantPool, offset + readOffset);
			readOffset += 8;
		}
	}
	this.attributesCount = u2At(classFileBytes, readOffset, offset);
	this.attributes = ClassFileAttribute.NO_ATTRIBUTES;
	if (this.attributesCount != 0) {
		this.attributes = new IClassFileAttribute[this.attributesCount];
	}
	int attributesIndex = 0;
	readOffset += 2;
	for (int i = 0; i < this.attributesCount; i++) {
		IConstantPoolEntry constantPoolEntry = constantPool.decodeEntry(u2At(classFileBytes, readOffset, offset));
		if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Utf8) {
			throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
		}
		char[] attributeName = constantPoolEntry.getUtf8Value();
		if (equals(attributeName, IAttributeNamesConstants.LINE_NUMBER)) {
			this.lineNumberAttribute = new LineNumberAttribute(classFileBytes, constantPool, offset + readOffset);
			this.attributes[attributesIndex++] = this.lineNumberAttribute;
		} else if (equals(attributeName, IAttributeNamesConstants.LOCAL_VARIABLE)) {
			this.localVariableAttribute = new LocalVariableAttribute(classFileBytes, constantPool, offset + readOffset);
			this.attributes[attributesIndex++] = this.localVariableAttribute;
		} else if (equals(attributeName, IAttributeNamesConstants.LOCAL_VARIABLE_TYPE_TABLE)) {
			this.attributes[attributesIndex++] = new LocalVariableTypeAttribute(classFileBytes, constantPool, offset + readOffset);
		} else if (equals(attributeName, IAttributeNamesConstants.STACK_MAP_TABLE)) {
			this.attributes[attributesIndex++] = new StackMapTableAttribute(classFileBytes, constantPool, offset + readOffset);
		} else if (equals(attributeName, IAttributeNamesConstants.STACK_MAP)) {
			this.attributes[attributesIndex++] = new StackMapAttribute(classFileBytes, constantPool, offset + readOffset);
		} else if (equals(attributeName, IAttributeNamesConstants.RUNTIME_VISIBLE_TYPE_ANNOTATIONS)) {
			this.attributes[attributesIndex++] = new RuntimeVisibleTypeAnnotationsAttribute(classFileBytes, constantPool, offset + readOffset);
		} else if (equals(attributeName, IAttributeNamesConstants.RUNTIME_INVISIBLE_TYPE_ANNOTATIONS)) {
			this.attributes[attributesIndex++] = new RuntimeInvisibleTypeAnnotationsAttribute(classFileBytes, constantPool, offset + readOffset);
		} else {
			this.attributes[attributesIndex++] = new ClassFileAttribute(classFileBytes, constantPool, offset + readOffset);
		}
		readOffset += (6 + u4At(classFileBytes, readOffset + 2, offset));
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:55,代码来源:CodeAttribute.java


示例4: getAttributes

import org.eclipse.jdt.core.util.IClassFileAttribute; //导入依赖的package包/类
/**
 * @see ICodeAttribute#getAttributes()
 */
public IClassFileAttribute[] getAttributes() {
	return this.attributes;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:7,代码来源:CodeAttribute.java


示例5: getAttributes

import org.eclipse.jdt.core.util.IClassFileAttribute; //导入依赖的package包/类
/**
 * @see IMethodInfo#getAttributes()
 */
public IClassFileAttribute[] getAttributes() {
	return this.attributes;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:7,代码来源:MethodInfo.java


示例6: getAttributes

import org.eclipse.jdt.core.util.IClassFileAttribute; //导入依赖的package包/类
/**
 * @see IClassFileReader#getAttributes()
 */
public IClassFileAttribute[] getAttributes() {
	return this.attributes;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:7,代码来源:ClassFileReader.java


示例7: FieldInfo

import org.eclipse.jdt.core.util.IClassFileAttribute; //导入依赖的package包/类
/**
 * @param classFileBytes byte[]
 * @param constantPool IConstantPool
 * @param offset int
 */
public FieldInfo(byte classFileBytes[], IConstantPool constantPool, int offset)
	throws ClassFormatException {
	final int flags = u2At(classFileBytes, 0, offset);
	this.accessFlags = flags;
	if ((flags & IModifierConstants.ACC_SYNTHETIC) != 0) {
		this.isSynthetic = true;
	}
	this.nameIndex = u2At(classFileBytes, 2, offset);
	IConstantPoolEntry constantPoolEntry = constantPool.decodeEntry(this.nameIndex);
	if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Utf8) {
		throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
	}
	this.name = constantPoolEntry.getUtf8Value();

	this.descriptorIndex = u2At(classFileBytes, 4, offset);
	constantPoolEntry = constantPool.decodeEntry(this.descriptorIndex);
	if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Utf8) {
		throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
	}
	this.descriptor = constantPoolEntry.getUtf8Value();

	this.attributesCount = u2At(classFileBytes, 6, offset);
	this.attributes = ClassFileAttribute.NO_ATTRIBUTES;
	int readOffset = 8;
	if (this.attributesCount != 0) {
		this.attributes = new IClassFileAttribute[this.attributesCount];
	}
	int attributesIndex = 0;
	for (int i = 0; i < this.attributesCount; i++) {
		constantPoolEntry = constantPool.decodeEntry(u2At(classFileBytes, readOffset, offset));
		if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Utf8) {
			throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
		}
		char[] attributeName = constantPoolEntry.getUtf8Value();
		if (equals(attributeName, IAttributeNamesConstants.DEPRECATED)) {
			this.isDeprecated = true;
			this.attributes[attributesIndex++] = new ClassFileAttribute(classFileBytes, constantPool, offset + readOffset);
		} else if (equals(attributeName, IAttributeNamesConstants.SYNTHETIC)) {
			this.isSynthetic = true;
			this.attributes[attributesIndex++] = new ClassFileAttribute(classFileBytes, constantPool, offset + readOffset);
		} else if (equals(attributeName, IAttributeNamesConstants.CONSTANT_VALUE)) {
			this.constantValueAttribute = new ConstantValueAttribute(classFileBytes, constantPool, offset + readOffset);
			this.attributes[attributesIndex++] = this.constantValueAttribute;
		} else if (equals(attributeName, IAttributeNamesConstants.SIGNATURE)) {
			this.attributes[attributesIndex++] = new SignatureAttribute(classFileBytes, constantPool, offset + readOffset);
		} else if (equals(attributeName, IAttributeNamesConstants.RUNTIME_VISIBLE_ANNOTATIONS)) {
			this.attributes[attributesIndex++] = new RuntimeVisibleAnnotationsAttribute(classFileBytes, constantPool, offset + readOffset);
		} else if (equals(attributeName, IAttributeNamesConstants.RUNTIME_INVISIBLE_ANNOTATIONS)) {
			this.attributes[attributesIndex++] = new RuntimeInvisibleAnnotationsAttribute(classFileBytes, constantPool, offset + readOffset);
		} else if (equals(attributeName, IAttributeNamesConstants.RUNTIME_VISIBLE_TYPE_ANNOTATIONS)) {
			this.attributes[attributesIndex++] = new RuntimeVisibleTypeAnnotationsAttribute(classFileBytes, constantPool, offset + readOffset);
		} else if (equals(attributeName, IAttributeNamesConstants.RUNTIME_INVISIBLE_TYPE_ANNOTATIONS)) {
			this.attributes[attributesIndex++] = new RuntimeInvisibleTypeAnnotationsAttribute(classFileBytes, constantPool, offset + readOffset);
		} else {
			this.attributes[attributesIndex++] = new ClassFileAttribute(classFileBytes, constantPool, offset + readOffset);
		}
		readOffset += (6 + u4At(classFileBytes, readOffset + 2, offset));
	}

	this.attributeBytes = readOffset;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:67,代码来源:FieldInfo.java


示例8: getAttributes

import org.eclipse.jdt.core.util.IClassFileAttribute; //导入依赖的package包/类
/**
 * @see IFieldInfo#getAttributes()
 */
public IClassFileAttribute[] getAttributes() {
	return this.attributes;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:7,代码来源:FieldInfo.java


示例9: CodeAttribute

import org.eclipse.jdt.core.util.IClassFileAttribute; //导入依赖的package包/类
CodeAttribute(byte[] classFileBytes, IConstantPool constantPool, int offset) throws ClassFormatException {
	super(classFileBytes, constantPool, offset);
	this.classFileBytes = classFileBytes;
	this.constantPool = constantPool;
	this.maxStack = u2At(classFileBytes, 6, offset);
	this.maxLocals = u2At(classFileBytes, 8, offset);
	this.codeLength = u4At(classFileBytes, 10, offset);
	this.codeOffset = offset + 14;
	int readOffset = (int) (14 + this.codeLength);
	this.exceptionTableLength = u2At(classFileBytes, readOffset, offset);
	readOffset += 2;
	this.exceptionTableEntries = NO_EXCEPTION_TABLE;
	if (this.exceptionTableLength != 0) {
		this.exceptionTableEntries = new ExceptionTableEntry[this.exceptionTableLength];
		for (int i = 0; i < this.exceptionTableLength; i++) {
			this.exceptionTableEntries [i] = new ExceptionTableEntry(classFileBytes, constantPool, offset + readOffset);
			readOffset += 8;
		}
	}
	this.attributesCount = u2At(classFileBytes, readOffset, offset);
	this.attributes = ClassFileAttribute.NO_ATTRIBUTES;
	if (this.attributesCount != 0) {
		this.attributes = new IClassFileAttribute[this.attributesCount];
	}
	int attributesIndex = 0;
	readOffset += 2;
	for (int i = 0; i < this.attributesCount; i++) {
		IConstantPoolEntry constantPoolEntry = constantPool.decodeEntry(u2At(classFileBytes, readOffset, offset));
		if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Utf8) {
			throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
		}
		char[] attributeName = constantPoolEntry.getUtf8Value();
		if (equals(attributeName, IAttributeNamesConstants.LINE_NUMBER)) {
			this.lineNumberAttribute = new LineNumberAttribute(classFileBytes, constantPool, offset + readOffset);
			this.attributes[attributesIndex++] = this.lineNumberAttribute;
		} else if (equals(attributeName, IAttributeNamesConstants.LOCAL_VARIABLE)) {
			this.localVariableAttribute = new LocalVariableAttribute(classFileBytes, constantPool, offset + readOffset);
			this.attributes[attributesIndex++] = this.localVariableAttribute;
		} else if (equals(attributeName, IAttributeNamesConstants.LOCAL_VARIABLE_TYPE_TABLE)) {
			this.attributes[attributesIndex++] = new LocalVariableTypeAttribute(classFileBytes, constantPool, offset + readOffset);
		} else if (equals(attributeName, IAttributeNamesConstants.STACK_MAP_TABLE)) {
			this.attributes[attributesIndex++] = new StackMapTableAttribute(classFileBytes, constantPool, offset + readOffset);
		} else if (equals(attributeName, IAttributeNamesConstants.STACK_MAP)) {
			this.attributes[attributesIndex++] = new StackMapAttribute(classFileBytes, constantPool, offset + readOffset);
		} else {
			this.attributes[attributesIndex++] = new ClassFileAttribute(classFileBytes, constantPool, offset + readOffset);
		}
		readOffset += (6 + u4At(classFileBytes, readOffset + 2, offset));
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:51,代码来源:CodeAttribute.java


示例10: FieldInfo

import org.eclipse.jdt.core.util.IClassFileAttribute; //导入依赖的package包/类
/**
 * @param classFileBytes byte[]
 * @param constantPool IConstantPool
 * @param offset int
 */
public FieldInfo(byte classFileBytes[], IConstantPool constantPool, int offset)
	throws ClassFormatException {
	final int flags = u2At(classFileBytes, 0, offset);
	this.accessFlags = flags;
	if ((flags & IModifierConstants.ACC_SYNTHETIC) != 0) {
		this.isSynthetic = true;
	}
	this.nameIndex = u2At(classFileBytes, 2, offset);
	IConstantPoolEntry constantPoolEntry = constantPool.decodeEntry(this.nameIndex);
	if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Utf8) {
		throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
	}
	this.name = constantPoolEntry.getUtf8Value();

	this.descriptorIndex = u2At(classFileBytes, 4, offset);
	constantPoolEntry = constantPool.decodeEntry(this.descriptorIndex);
	if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Utf8) {
		throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
	}
	this.descriptor = constantPoolEntry.getUtf8Value();

	this.attributesCount = u2At(classFileBytes, 6, offset);
	this.attributes = ClassFileAttribute.NO_ATTRIBUTES;
	int readOffset = 8;
	if (this.attributesCount != 0) {
		this.attributes = new IClassFileAttribute[this.attributesCount];
	}
	int attributesIndex = 0;
	for (int i = 0; i < this.attributesCount; i++) {
		constantPoolEntry = constantPool.decodeEntry(u2At(classFileBytes, readOffset, offset));
		if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Utf8) {
			throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
		}
		char[] attributeName = constantPoolEntry.getUtf8Value();
		if (equals(attributeName, IAttributeNamesConstants.DEPRECATED)) {
			this.isDeprecated = true;
			this.attributes[attributesIndex++] = new ClassFileAttribute(classFileBytes, constantPool, offset + readOffset);
		} else if (equals(attributeName, IAttributeNamesConstants.SYNTHETIC)) {
			this.isSynthetic = true;
			this.attributes[attributesIndex++] = new ClassFileAttribute(classFileBytes, constantPool, offset + readOffset);
		} else if (equals(attributeName, IAttributeNamesConstants.CONSTANT_VALUE)) {
			this.constantValueAttribute = new ConstantValueAttribute(classFileBytes, constantPool, offset + readOffset);
			this.attributes[attributesIndex++] = this.constantValueAttribute;
		} else if (equals(attributeName, IAttributeNamesConstants.SIGNATURE)) {
			this.attributes[attributesIndex++] = new SignatureAttribute(classFileBytes, constantPool, offset + readOffset);
		} else if (equals(attributeName, IAttributeNamesConstants.RUNTIME_VISIBLE_ANNOTATIONS)) {
			this.attributes[attributesIndex++] = new RuntimeVisibleAnnotationsAttribute(classFileBytes, constantPool, offset + readOffset);
		} else if (equals(attributeName, IAttributeNamesConstants.RUNTIME_INVISIBLE_ANNOTATIONS)) {
			this.attributes[attributesIndex++] = new RuntimeInvisibleAnnotationsAttribute(classFileBytes, constantPool, offset + readOffset);
		} else {
			this.attributes[attributesIndex++] = new ClassFileAttribute(classFileBytes, constantPool, offset + readOffset);
		}
		readOffset += (6 + u4At(classFileBytes, readOffset + 2, offset));
	}

	this.attributeBytes = readOffset;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:63,代码来源:FieldInfo.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java CompressionException类代码示例发布时间:2022-05-16
下一篇:
Java SaveAttributeFileAction类代码示例发布时间:2022-05-16
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap